Skip to content

Commit c84b6a0

Browse files
committed
[GR-24462] Remove obsolete TODO + fix guard completeness in ToIntNode & ToLongNode.
PullRequest: truffleruby/1743
2 parents dc8d67b + be537d4 commit c84b6a0

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/main/java/org/truffleruby/core/array/ArrayAppendOneNode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ protected DynamicObject appendOneGeneralizeNonMutable(DynamicObject array, Objec
8181
final int newCapacity = newSize > oldCapacity
8282
? ArrayUtils.capacityForOneMore(getContext(), oldCapacity)
8383
: oldCapacity;
84-
// TODO (norswap, 03 Apr 2020): this is a performance warning (inlining a virtual call)
8584
final Object newStore = currentStores.allocateForNewValue(currentStore, value, newCapacity);
8685
currentStores.copyContents(currentStore, 0, newStore, 0, oldSize);
8786
propagateSharingNode.executePropagate(array, value);

src/main/java/org/truffleruby/core/cast/ToIntNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected long coerceNil(Nil value) {
108108
coreExceptions().typeError("no implicit conversion from nil to integer", this));
109109
}
110110

111-
@Specialization(guards = { "!isRubyInteger(object)", "!isNil(object)" })
111+
@Specialization(guards = { "!isRubyInteger(object)", "!isDouble(object)", "!isNil(object)" })
112112
protected int coerceObject(Object object,
113113
@Cached CallDispatchHeadNode toIntNode,
114114
@Cached ToIntNode fitNode) {

src/main/java/org/truffleruby/core/cast/ToLongNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected long coerceNil(Nil nil) {
7878
coreExceptions().typeError("no implicit conversion from nil to integer", this));
7979
}
8080

81-
@Specialization(guards = { "!isRubyInteger(object)", "!isNil(object)" })
81+
@Specialization(guards = { "!isRubyInteger(object)", "!isDouble(object)", "!isNil(object)" })
8282
protected long coerceObject(Object object,
8383
@Cached CallDispatchHeadNode toIntNode,
8484
@Cached ToLongNode fitNode) {

0 commit comments

Comments
 (0)