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 203ab9f commit 7369daaCopy full SHA for 7369daa
src/regex/match_data.cr
@@ -295,15 +295,11 @@ class Regex
295
def to_s(io : IO)
296
name_table = @regex.name_table
297
298
- io << "#<Regex::MatchData "
299
- self[0].inspect(io)
300
- if size > 1
+ io << "#<Regex::MatchData"
+ size.times do |i|
301
io << " "
302
- (1...size).join " ", io do |i|
303
- io << name_table.fetch(i) { i }
304
- io << ":"
305
- self[i]?.inspect(io)
306
- end
+ io << name_table.fetch(i) { i } << ":" if i > 0
+ self[i]?.inspect(io)
307
end
308
io << ">"
309
0 commit comments