Skip to content

Commit 75de885

Browse files
committed
Remove Rope from names
1 parent 1ac5d06 commit 75de885

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/main/java/org/truffleruby/core/encoding/EncodingNodes.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected RubyEncoding negotiateStandardEncodingAndCr7Bit(
129129
"getCodeRange(first, firstEncoding) == firstCodeRange",
130130
"getCodeRange(second, secondEncoding) == secondCodeRange" },
131131
limit = "getCacheLimit()")
132-
protected RubyEncoding negotiateRopeRopeCached(
132+
protected RubyEncoding negotiateEncodingCached(
133133
AbstractTruffleString first,
134134
RubyEncoding firstEncoding,
135135
AbstractTruffleString second,
@@ -140,19 +140,19 @@ protected RubyEncoding negotiateRopeRopeCached(
140140
@Cached("getCodeRange(second, secondEncoding)") TruffleString.CodeRange secondCodeRange,
141141
@Cached("firstEncoding") RubyEncoding cachedFirstEncoding,
142142
@Cached("secondEncoding") RubyEncoding cachedSecondEncoding,
143-
@Cached("compatibleEncodingForRopes(first, firstEncoding, second, secondEncoding)") RubyEncoding negotiatedEncoding) {
143+
@Cached("compatibleEncodingForStrings(first, firstEncoding, second, secondEncoding)") RubyEncoding negotiatedEncoding) {
144144
assert first.isCompatibleTo(firstEncoding.tencoding) && second.isCompatibleTo(secondEncoding.tencoding);
145145
return negotiatedEncoding;
146146
}
147147

148-
@Specialization(guards = "firstEncoding != secondEncoding", replaces = "negotiateRopeRopeCached")
149-
protected RubyEncoding negotiateRopeRopeUncached(
148+
@Specialization(guards = "firstEncoding != secondEncoding", replaces = "negotiateEncodingCached")
149+
protected RubyEncoding negotiateEncodingUncached(
150150
AbstractTruffleString first,
151151
RubyEncoding firstEncoding,
152152
AbstractTruffleString second,
153153
RubyEncoding secondEncoding) {
154154
assert first.isCompatibleTo(firstEncoding.tencoding) && second.isCompatibleTo(secondEncoding.tencoding);
155-
return compatibleEncodingForRopes(first, firstEncoding, second, secondEncoding);
155+
return compatibleEncodingForStrings(first, firstEncoding, second, secondEncoding);
156156
}
157157

158158
/** This method returns non-null if either:
@@ -162,17 +162,17 @@ protected RubyEncoding negotiateRopeRopeUncached(
162162
* </ul>
163163
*/
164164
@TruffleBoundary
165-
protected RubyEncoding compatibleEncodingForRopes(AbstractTruffleString firstRope, RubyEncoding firstEncoding,
166-
AbstractTruffleString secondRope, RubyEncoding secondEncoding) {
165+
protected RubyEncoding compatibleEncodingForStrings(AbstractTruffleString first, RubyEncoding firstEncoding,
166+
AbstractTruffleString second, RubyEncoding secondEncoding) {
167167
// MRI: enc_compatible_latter
168168
assert firstEncoding != secondEncoding : "this method assumes the encodings are different";
169169

170-
if (secondRope.isEmpty()) {
170+
if (second.isEmpty()) {
171171
return firstEncoding;
172172
}
173-
if (firstRope.isEmpty()) {
173+
if (first.isEmpty()) {
174174
return (firstEncoding.isAsciiCompatible &&
175-
StringGuards.is7Bit(secondRope, secondEncoding, getCodeRangeNode()))
175+
StringGuards.is7Bit(second, secondEncoding, getCodeRangeNode()))
176176
? firstEncoding
177177
: secondEncoding;
178178
}
@@ -181,10 +181,10 @@ protected RubyEncoding compatibleEncodingForRopes(AbstractTruffleString firstRop
181181
return null;
182182
}
183183

184-
if (StringGuards.is7Bit(secondRope, secondEncoding, getCodeRangeNode())) {
184+
if (StringGuards.is7Bit(second, secondEncoding, getCodeRangeNode())) {
185185
return firstEncoding;
186186
}
187-
if (StringGuards.is7Bit(firstRope, firstEncoding, getCodeRangeNode())) {
187+
if (StringGuards.is7Bit(first, firstEncoding, getCodeRangeNode())) {
188188
return secondEncoding;
189189
}
190190

@@ -255,10 +255,10 @@ protected RubyEncoding negotiateSameEncodingUncached(Object first, Object second
255255
protected RubyEncoding negotiateStringStringEncoding(Object first, Object second,
256256
@Cached RubyStringLibrary libFirst,
257257
@Cached RubyStringLibrary libSecond,
258-
@Cached NegotiateCompatibleStringEncodingNode ropeNode) {
258+
@Cached NegotiateCompatibleStringEncodingNode negotiateNode) {
259259
final RubyEncoding firstEncoding = libFirst.getEncoding(first);
260260
final RubyEncoding secondEncoding = libSecond.getEncoding(second);
261-
return ropeNode.execute(
261+
return negotiateNode.execute(
262262
libFirst.getTString(first),
263263
firstEncoding,
264264
libSecond.getTString(second),

src/main/java/org/truffleruby/core/time/TimeNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ protected boolean formatCanBeFast(Token[] pattern) {
458458
}
459459

460460
protected boolean yearIsFast(RubyTime time) {
461-
// See formatToRopeBuilderCanBeFast
461+
// See formatCanBeFast
462462
final int year = time.dateTime.getYear();
463463
return year >= 1000 && year <= 9999;
464464
}

src/main/java/org/truffleruby/parser/BodyTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ public RubyNode visitCallNode(CallParseNode node) {
499499
if (receiver instanceof StrParseNode &&
500500
(methodName.equals("freeze") || methodName.equals("-@"))) {
501501
final StrParseNode strNode = (StrParseNode) receiver;
502-
final TruffleString nodeRope = strNode.getValue();
503-
final ImmutableRubyString frozenString = language.getFrozenStringLiteral(nodeRope, strNode.encoding);
502+
final TruffleString tstring = strNode.getValue();
503+
final ImmutableRubyString frozenString = language.getFrozenStringLiteral(tstring, strNode.encoding);
504504
return addNewlineIfNeeded(node, withSourceSection(
505505
sourceSection,
506506
new FrozenStringLiteralNode(frozenString, FrozenStrings.METHOD)));

0 commit comments

Comments
 (0)