mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
f9243aa67a
Replace Ruby Hash usage in array set operations with khash.h for better memory efficiency and performance. This affects operations on arrays larger than 32 elements. Changes: - Add KHASH_DECLARE/DEFINE for ary_set_t (set mode) - Replace mrb_hash_* calls with kh_* equivalents - Add helper functions for temporary set management - Update all affected functions: * ary_subtract_internal (difference operations) * ary_union_internal (union operations) * ary_intersection_internal (intersection operations) * ary_intersect_p (intersection checking) * ary_uniq_bang (uniqueness operations) Benefits: - Better performance: direct C operations vs Ruby method calls - Consistent with mruby core architecture using khash.h - Eliminates unnecessary mrb_true_value() storage Co-authored-by: Claude <noreply@anthropic.com>