Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] Remove unused argument.
Browse files Browse the repository at this point in the history
eregon committed Jan 10, 2017
1 parent e4e8e11 commit 6d47431
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1368,7 +1368,7 @@ public abstract static class ScrubNode extends PrimitiveArrayArgumentsNode {
@Child private RopeNodes.MakeConcatNode makeConcatNode = RopeNodesFactory.MakeConcatNodeGen.create(null, null, null);

@Specialization(guards = { "!is7Bit(string)", "!isValidCodeRange(string)", "isAsciiCompatible(string)" })
public DynamicObject scrubAsciiCompat(VirtualFrame frame, DynamicObject string, Object repl, DynamicObject block) {
public DynamicObject scrubAsciiCompat(VirtualFrame frame, DynamicObject string, DynamicObject block) {
final Rope rope = rope(string);
final Encoding enc = rope.getEncoding();
Rope buf = RopeConstants.EMPTY_ASCII_8BIT_ROPE;
@@ -1415,8 +1415,8 @@ public DynamicObject scrubAsciiCompat(VirtualFrame frame, DynamicObject string,
}
}
Rope invalid = RopeOperations.create(ArrayUtils.extractRange(pBytes, p, p + clen), enc, CodeRange.CR_BROKEN);
repl = yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope((DynamicObject) repl), enc);
DynamicObject repl = (DynamicObject) yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope(repl), enc);
p += clen;
p1 = p;
p = StringSupport.searchNonAscii(pBytes, p, e);
@@ -1431,15 +1431,15 @@ public DynamicObject scrubAsciiCompat(VirtualFrame frame, DynamicObject string,
}
if (p < e) {
Rope invalid = RopeOperations.create(ArrayUtils.extractRange(pBytes, p, e), enc, CodeRange.CR_BROKEN);
repl = yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope((DynamicObject) repl), enc);
DynamicObject repl = (DynamicObject) yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope(repl), enc);
}

return createString(buf);
}

@Specialization(guards = { "!is7Bit(string)", "!isValidCodeRange(string)", "!isAsciiCompatible(string)" })
public DynamicObject scrubAscciIncompatible(VirtualFrame frame, DynamicObject string, Object repl, DynamicObject block) {
public DynamicObject scrubAscciIncompatible(VirtualFrame frame, DynamicObject string, DynamicObject block) {
final Rope rope = rope(string);
final Encoding enc = rope.getEncoding();
Rope buf = RopeConstants.EMPTY_ASCII_8BIT_ROPE;
@@ -1483,8 +1483,8 @@ public DynamicObject scrubAscciIncompatible(VirtualFrame frame, DynamicObject st
}

Rope invalid = RopeOperations.create(ArrayUtils.extractRange(pBytes, p, e), enc, CodeRange.CR_BROKEN);
repl = yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope((DynamicObject) repl), enc);
DynamicObject repl = (DynamicObject) yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope(repl), enc);
p += clen;
p1 = p;
}
@@ -1494,8 +1494,8 @@ public DynamicObject scrubAscciIncompatible(VirtualFrame frame, DynamicObject st
}
if (p < e) {
Rope invalid = RopeOperations.create(ArrayUtils.extractRange(pBytes, p, e), enc, CodeRange.CR_BROKEN);
repl = yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope((DynamicObject) repl), enc);
DynamicObject repl = (DynamicObject) yield(frame, block, createString(invalid));
buf = makeConcatNode.executeMake(buf, rope(repl), enc);
}

return createString(buf);
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/string.rb
Original file line number Diff line number Diff line change
@@ -1221,7 +1221,7 @@ def scrub(replace = nil, &block)
}
end

val = Truffle.invoke_primitive(:string_scrub, self, nil, replace_block)
val = Truffle.invoke_primitive(:string_scrub, self, replace_block)
val.taint if taint
val
end

0 comments on commit 6d47431

Please sign in to comment.