Skip to content

Commit 9b445b0

Browse files
committed
[GR-16315] Removed the increment specialization for integer addition.
PullRequest: truffleruby/880
2 parents 8329b5b + 62d6ac1 commit 9b445b0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/org/truffleruby/core/numeric/IntegerNodes.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,7 @@ public abstract static class AddNode extends BignumCoreMethodNode {
106106

107107
public abstract Object executeAdd(Object a, Object b);
108108

109-
@Specialization(guards = "b == 1", rewriteOn = ArithmeticException.class)
110-
public int incInt(int a, int b) {
111-
return Math.incrementExact(a);
112-
}
113-
114-
@Specialization(rewriteOn = ArithmeticException.class, replaces = "incInt")
109+
@Specialization(rewriteOn = ArithmeticException.class)
115110
public int add(int a, int b) {
116111
return Math.addExact(a, b);
117112
}

0 commit comments

Comments
 (0)