class ActionDispatch::Journey::Scanner

def dedup_scan(regex)

see: https://bugs.ruby-lang.org/issues/13077
takes advantage of String @- deduping capabilities in Ruby 2.5 upwards
def dedup_scan(regex)
  r = @ss.scan(regex)
  r ? -r : nil
end