Skip to content

Commit 78544e6

Browse files
committed
Simplify BaseSetBuiltins binary ops
1 parent fca41a2 commit 78544e6

File tree

1 file changed

+4
-6
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/set

1 file changed

+4
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/set/BaseSetBuiltins.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,13 @@ protected abstract static class BaseLessThanNode extends PythonBinaryBuiltinNode
379379
static boolean isLessThan(VirtualFrame frame, PBaseSet self, PBaseSet other,
380380
@CachedLibrary(limit = "2") HashingStorageLibrary hlib,
381381
@Cached ConditionProfile hasFrameProfile,
382-
@Cached ConditionProfile sizeProfile,
383-
@Cached BaseLessEqualNode lessEqualNode) {
382+
@Cached ConditionProfile sizeProfile) {
384383
final int len1 = hlib.lengthWithFrame(self.getDictStorage(), hasFrameProfile, frame);
385384
final int len2 = hlib.lengthWithFrame(other.getDictStorage(), hasFrameProfile, frame);
386385
if (sizeProfile.profile(len1 >= len2)) {
387386
return false;
388387
}
389-
return (Boolean) lessEqualNode.execute(frame, self, other);
388+
return BaseLessEqualNode.doLE(frame, self, other, hasFrameProfile, hlib);
390389
}
391390

392391
@Specialization
@@ -409,14 +408,13 @@ protected abstract static class BaseGreaterThanNode extends PythonBinaryBuiltinN
409408
static boolean isGreaterThan(VirtualFrame frame, PBaseSet self, PBaseSet other,
410409
@CachedLibrary(limit = "2") HashingStorageLibrary hlib,
411410
@Cached ConditionProfile hasFrameProfile,
412-
@Cached ConditionProfile sizeProfile,
413-
@Cached BaseGreaterEqualNode greaterEqualNode) {
411+
@Cached ConditionProfile sizeProfile) {
414412
final int len1 = hlib.lengthWithFrame(self.getDictStorage(), hasFrameProfile, frame);
415413
final int len2 = hlib.lengthWithFrame(other.getDictStorage(), hasFrameProfile, frame);
416414
if (sizeProfile.profile(len1 <= len2)) {
417415
return false;
418416
}
419-
return (Boolean) greaterEqualNode.execute(frame, self, other);
417+
return BaseGreaterEqualNode.doGE(frame, self, other, hasFrameProfile, hlib);
420418
}
421419

422420
@Specialization

0 commit comments

Comments
 (0)