Skip to content

Commit 1ecf707

Browse files
committed
Use RopeOperations.withEncoding() instead of the internal Rope#withEncoding()
1 parent 314e73b commit 1ecf707

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ public static Rope quote19(Rope bs) {
722722
p += cl;
723723
}
724724
if (asciiOnly) {
725-
return bs.withEncoding(USASCIIEncoding.INSTANCE, CR_7BIT);
725+
return RopeOperations.withEncoding(bs, USASCIIEncoding.INSTANCE);
726726
}
727727
return bs;
728728
} while (false);

src/main/java/org/truffleruby/core/rope/RepeatingRope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public RepeatingRope(ManagedRope child, int times) {
3434

3535
@Override
3636
public Rope withEncoding(Encoding newEncoding, CodeRange newCodeRange) {
37-
return new RepeatingRope((ManagedRope) child.withEncoding(newEncoding, newCodeRange), times);
37+
return new RepeatingRope((ManagedRope) RopeOperations.withEncoding(child, newEncoding), times);
3838
}
3939

4040
@Override

src/main/java/org/truffleruby/core/symbol/SymbolTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private RopeKey createRopeKey(Rope rope) {
131131
}
132132

133133
if (rope.isAsciiOnly() && rope.getEncoding() != USASCIIEncoding.INSTANCE) {
134-
rope = rope.withEncoding(USASCIIEncoding.INSTANCE, CodeRange.CR_7BIT);
134+
rope = RopeOperations.withEncoding(rope, USASCIIEncoding.INSTANCE);
135135
}
136136

137137
return new RopeKey(rope, hashing);

0 commit comments

Comments
 (0)