Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -37,23 +37,21 @@ public Rope getRope() {
CompilerDirectives.transferToInterpreterAndInvalidate();
rope = createRope();
}

return rope;
}

public DynamicObject createInstance() {
return StringOperations.createString(context, getRope());
}

private Rope createRope() {
// getRope is fully synchronised and returns identically the same object for the same parameters

// RopeTable.getRope is fully synchronized and returns the same object for equivalent parameters
return context.getRopeTable().getRope(
literal.getBytes(StandardCharsets.US_ASCII),
ASCIIEncoding.INSTANCE,
CodeRange.CR_7BIT);
}

public DynamicObject createInstance() {
return StringOperations.createString(context, getRope());
}

private static boolean is7Bit(String literal) {
for (int n = 0; n < literal.length(); n++) {
if (literal.charAt(n) > 0b1111111) {

0 comments on commit 63686f5

Please sign in to comment.