@@ -778,7 +778,6 @@ public abstract static class FloatNode extends PythonBinaryBuiltinNode {
778
778
@ Child private LookupAndCallUnaryNode callReprNode ;
779
779
780
780
@ Child private IsBuiltinClassProfile isPrimitiveProfile = IsBuiltinClassProfile .create ();
781
- private ConditionProfile isNanProfile ;
782
781
783
782
public abstract Object executeWith (VirtualFrame frame , Object cls , Object arg );
784
783
@@ -828,7 +827,7 @@ Object floatFromDouble(Object cls, double arg) {
828
827
if (isPrimitiveFloat (cls )) {
829
828
return arg ;
830
829
}
831
- return factoryCreateFloat (cls , arg );
830
+ return factory (). createFloat (cls , arg );
832
831
}
833
832
834
833
@ Specialization (guards = "!isNativeClass(cls)" )
@@ -837,7 +836,7 @@ Object floatFromString(VirtualFrame frame, Object cls, String arg) {
837
836
if (isPrimitiveFloat (cls )) {
838
837
return value ;
839
838
}
840
- return factoryCreateFloat (cls , value );
839
+ return factory (). createFloat (cls , value );
841
840
}
842
841
843
842
private double convertBytesToDouble (VirtualFrame frame , PBytesLike arg ) {
@@ -980,21 +979,6 @@ private byte[] getByteArray(VirtualFrame frame, PBytesLike pByteArray) {
980
979
}
981
980
return toByteArrayNode .execute (frame , pByteArray );
982
981
}
983
-
984
- private PFloat factoryCreateFloat (Object cls , double arg ) {
985
- if (isNaN (arg )) {
986
- return getCore ().getNaN ();
987
- }
988
- return factory ().createFloat (cls , arg );
989
- }
990
-
991
- private boolean isNaN (double d ) {
992
- if (isNanProfile == null ) {
993
- CompilerDirectives .transferToInterpreterAndInvalidate ();
994
- isNanProfile = ConditionProfile .createBinaryProfile ();
995
- }
996
- return isNanProfile .profile (Double .isNaN (d ));
997
- }
998
982
}
999
983
1000
984
// frozenset([iterable])
0 commit comments