We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53a30af commit 6ef19f6Copy full SHA for 6ef19f6
src/main/ruby/truffleruby/core/match_data.rb
@@ -169,11 +169,11 @@ def to_s
169
def backref_from_arg(index)
170
if Primitive.is_a?(index, String) || Primitive.is_a?(index, Symbol)
171
names_to_backref = Hash[Primitive.regexp_names(self.regexp)]
172
- key = index.to_sym
+ array = names_to_backref[index.to_sym]
173
174
- raise IndexError, "undefined group name reference: #{index}" unless names_to_backref.key?(key)
+ raise IndexError, "undefined group name reference: #{index}" unless array
175
176
- return names_to_backref[key].last
+ return array.last
177
end
178
179
Primitive.rb_to_int(index)
0 commit comments