mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
The RFC2396 5.2 6a step used Array#index/slice! in a loop, making URI.join / URI#merge O(n^2) in the number of base-path segments, so a 640KB base of repeated "a/../" took several seconds. Rewrite it as a single left-to-right pass while preserving the exact previous output, including the leading-".." case where the whole base path is dropped. https://github.com/ruby/uri/commit/07f5883bfc Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>