Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c4ee1c94399b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d93b27b54ce
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 8, 2016

  1. Copy the full SHA
    8454ab9 View commit details
  2. Copy the full SHA
    8d93b27 View commit details
Original file line number Diff line number Diff line change
@@ -1484,17 +1484,6 @@ public Object lstripBang(DynamicObject string) {
}
}

@NonStandard
@CoreMethod(names = "modify!", raiseIfFrozenSelf = true)
public abstract static class ModifyBangNode extends CoreMethodArrayArgumentsNode {

@Specialization
public DynamicObject modifyBang(DynamicObject string) {
StringOperations.modify(string);
return string;
}
}

@NonStandard
@CoreMethod(names = "num_bytes=", lowerFixnumParameters = 0, required = 1)
public abstract static class SetNumBytesNode extends CoreMethodArrayArgumentsNode {
Original file line number Diff line number Diff line change
@@ -134,18 +134,7 @@ public static void keepCodeRange(DynamicObject string) {
}
}

public static void modify(DynamicObject string) {
// No-op. Ropes are immutable so any modifications must've been handled elsewhere.
// TODO (nirvdrum 07-Jan-16) Remove this method once we've inspected each caller for correctness.
}

public static void modify(DynamicObject string, int length) {
// No-op. Ropes are immutable so any modifications must've been handled elsewhere.
// TODO (nirvdrum 07-Jan-16) Remove this method once we've inspected each caller for correctness.
}

public static void modifyAndKeepCodeRange(DynamicObject string) {
modify(string);
keepCodeRange(string);
}

@@ -165,11 +154,6 @@ public static Encoding checkEncoding(DynamicObject string, CodeRangeable other)
return encoding;
}

public static void forceEncodingVerySlow(DynamicObject string, Encoding encoding) {
final Rope oldRope = Layouts.STRING.getRope(string);
StringOperations.setRope(string, RopeOperations.withEncodingVerySlow(oldRope, encoding, CodeRange.CR_UNKNOWN));
}

public static int normalizeIndex(int length, int index) {
return ArrayOperations.normalizeIndex(length, index);
}
1 change: 0 additions & 1 deletion truffle/src/main/ruby/core/string.rb
Original file line number Diff line number Diff line change
@@ -435,7 +435,6 @@ def suffix?(other)
end

def shorten!(size)
self.modify!
return if bytesize == 0
self.num_bytes -= size
end