Files
mruby-mruby/include
Yukihiro "Matz" Matsumoto 633544e087 khash: add flag operation helpers to eliminate bit manipulation duplication
Added two helper functions to encapsulate repeated flag manipulation patterns:
- kh_mark_occupied_##name(): clears both empty and deleted bits
- kh_mark_deleted_##name(): sets the deleted bit

Replaced 3 instances of manual bit manipulation with calls to these helpers:
- ed_flags[del_k/4] &= ~__m_del[del_k%4] → kh_mark_occupied_##name(h, del_k)
- ed_flags[k/4] &= ~__m_empty[k%4] → kh_mark_occupied_##name(h, k)
- ed_flags[x/4] |= __m_del[x%4] → kh_mark_deleted_##name(h, x)

This eliminates error-prone bit operations, improves readability, and makes
the flag state transitions self-documenting.

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-14 10:53:05 +09:00
..