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 845b85a commit 07331aeCopy full SHA for 07331ae
lib/json_mend/parser.rb
@@ -1088,13 +1088,8 @@ def parse_comment
1088
# It quickly iterates to find a character, handling escaped characters, and
1089
# returns the index (offset) from the scanner
1090
def skip_to_character(characters, start_idx: 0)
1091
- pattern = if characters.is_a?(Regexp)
1092
- characters
1093
- else
1094
- # Escape if it's a string, join if it's an array
1095
- chars = Array(characters).map { |c| Regexp.escape(c.to_s) }
1096
- Regexp.new(chars.join('|'))
1097
- end
+ chars = Array(characters).map { |c| Regexp.escape(c.to_s) }
+ pattern = Regexp.new(chars.join('|'))
1098
1099
saved_pos = @scanner.pos
1100
# Skip start_idx
0 commit comments