mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
90fd382a9e
Moved Array#fetch from Ruby to C using hybrid implementation for better performance. The C implementation handles all non-block cases with unified API that eliminates Ruby conditional logic. Key improvements: - Fast C implementation for common cases (no blocks) - Shared index normalization helper reusable for other methods - Unified C call eliminates NONE sentinel comparison in Ruby - Block cases use C helper for index normalization Added comprehensive test coverage including edge cases, default values, block handling, and error message format verification. Combined tests to focus on functionality rather than implementation details. Co-authored-by: Atlassian Rovo Dev