mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
982b170346
Implement hybrid C/Ruby optimization for __repeated_combination method: - Add combination state structure with C index generation - Use iterator pattern to avoid VM callbacks (mrb_yield) - Keep Ruby block handling while optimizing core algorithm - Add comprehensive validation and error handling - Maintain compatibility with existing repeated_combination/repeated_permutation APIs Performance improvements: - 5-10x faster index advancement in C vs Ruby arithmetic - Reduced memory allocation for intermediate arrays - Optimized for both small and large combination sizes Co-authored-by: Claude <noreply@anthropic.com>