Skip to content

Commit

Permalink
[Truffle] Remove unused argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 10, 2017
1 parent e4e8e11 commit 6d47431
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/string.rb
Expand Up @@ -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
Expand Down

0 comments on commit 6d47431

Please sign in to comment.