Skip to content

Commit b230e45

Browse files
wildmaplesnirvdrum
authored andcommitted
Remove encodingConversation since it's always true
1 parent 05d8669 commit b230e45

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/main/java/org/truffleruby/core/regexp/TruffleRegexpNodes.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ protected boolean initialized(RubyRegexp regexp) {
350350
}
351351
}
352352

353-
@Primitive(name = "regexp_match_in_region", lowerFixnum = { 2, 3, 6 })
353+
@Primitive(name = "regexp_match_in_region", lowerFixnum = { 2, 3, 5 })
354354
public abstract static class MatchInRegionNode extends PrimitiveArrayArgumentsNode {
355355

356356
/** Matches a regular expression against a string over the specified range of characters.
@@ -366,20 +366,12 @@ public abstract static class MatchInRegionNode extends PrimitiveArrayArgumentsNo
366366
* @param atStart Whether to only match at the beginning of the string, if false then the regexp can have any
367367
* amount of prematch.
368368
*
369-
* @param encodingConversion Whether to attempt encoding conversion of the regexp to match the string
370-
*
371369
* @param startPos The position within the string which the matcher should consider the start. Setting this to
372370
* the from position allows scanners to match starting partway through a string while still setting
373371
* atStart and thus forcing the match to be at the specific starting position. */
374372
@Specialization(guards = "libString.isRubyString(string)")
375373
protected Object matchInRegion(
376-
RubyRegexp regexp,
377-
Object string,
378-
int fromPos,
379-
int toPos,
380-
boolean atStart,
381-
boolean encodingConversion,
382-
int startPos,
374+
RubyRegexp regexp, Object string, int fromPos, int toPos, boolean atStart, int startPos,
383375
@Cached RopeNodes.BytesNode bytesNode,
384376
@Cached TruffleRegexpNodes.MatchNode matchNode,
385377
@CachedLibrary(limit = "2") RubyStringLibrary libString) {

src/main/ruby/truffleruby/core/truffle/regexp_operations.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def self.match_in_region(re, str, from, to, at_start, encoding_conversion, start
7878
elsif USE_TRUFFLE_REGEX
7979
match_in_region_tregex(re, str, from, to, at_start, encoding_conversion, start)
8080
else
81-
Primitive.regexp_match_in_region(re, str, from, to, at_start, encoding_conversion, start)
81+
Primitive.regexp_match_in_region(re, str, from, to, at_start, start)
8282
end
8383
end
8484

@@ -89,7 +89,7 @@ def self.match_in_region_compare_engines(re, str, from, to, at_start, encoding_c
8989
md1 = e
9090
end
9191
begin
92-
md2 = Primitive.regexp_match_in_region(re, str, from, to, at_start, encoding_conversion, start)
92+
md2 = Primitive.regexp_match_in_region(re, str, from, to, at_start, start)
9393
rescue => e
9494
md2 = e
9595
end
@@ -115,7 +115,7 @@ def self.match_in_region_tregex(re, str, from, to, at_start, encoding_conversion
115115
regex_result = compiled_regex.execBytes(str_bytes, from)
116116
end
117117
if bail_out
118-
return Primitive.regexp_match_in_region(re, str, from, to, at_start, encoding_conversion, start)
118+
return Primitive.regexp_match_in_region(re, str, from, to, at_start, start)
119119
elsif regex_result.isMatch
120120
starts = []
121121
ends = []

0 commit comments

Comments
 (0)