Skip to content

Commit 62d6ac1

Browse files
committed
Removed the increment specialization for integer addition.
1 parent ac1617a commit 62d6ac1

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
@@ -107,12 +107,7 @@ public abstract static class AddNode extends BignumCoreMethodNode {
107107

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

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

0 commit comments

Comments
 (0)