mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
7368be7568
Add kh_replace function that uses direct memory copying instead of element-by-element rehashing for improved performance. - Add kh_replace_name function with smart handling of different table types - Optimize kh_copy to use kh_replace instead of element iteration - Update Set operations to use kh_replace for copying - Remove redundant kset_copy_replace function The optimization provides O(1) memory copy vs O(n) hash operations, handles small tables and hash tables correctly, and avoids infinite recursion issues with self-referential data structures. Co-authored-by: Claude <noreply@anthropic.com>