mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fdb0a664c6
The Ruby implementation of `Array#difference` was inefficient as it called `Array#-` repeatedly, creating intermediate arrays. This commit replaces it with a C implementation that processes all arguments in a single pass. The core logic is extracted into a shared helper function, `ary_subtract_internal`, which is now used by both `Array#-` and `Array#difference`. Co-authored-by: Gemini <gemini@google.com>