87
87
public final class TimeModuleBuiltins extends PythonBuiltins {
88
88
private static final int DELAY_NANOS = 10 ;
89
89
private static final long PERF_COUNTER_START = TruffleOptions .AOT ? 0 : System .nanoTime ();
90
+ private static final String CTIME_FORMAT = "%s %s %2d %02d:%02d:%02d %d" ;
90
91
91
92
@ Override
92
93
protected List <? extends NodeFactory <? extends PythonBuiltinBaseNode >> getNodeFactories () {
@@ -850,16 +851,14 @@ private static long op(int[] integers) {
850
851
@ GenerateNodeFactory
851
852
public abstract static class CTimeNode extends PythonBuiltinNode {
852
853
853
- private static final String FORMAT = "%s %s %2d %02d:%02d:%02d %d" ;
854
-
855
854
@ Specialization
856
855
public String localtime (VirtualFrame frame , Object seconds ,
857
856
@ Cached ToLongTime toLongTime ) {
858
857
return format (getIntLocalTimeStruct (toLongTime .execute (frame , seconds )));
859
858
}
860
859
861
860
protected static String format (int [] tm ) {
862
- return ASCTimeNode .format (FORMAT , tm );
861
+ return ASCTimeNode .format (CTIME_FORMAT , tm );
863
862
}
864
863
}
865
864
@@ -868,7 +867,6 @@ protected static String format(int[] tm) {
868
867
@ GenerateNodeFactory
869
868
public abstract static class ASCTimeNode extends PythonBuiltinNode {
870
869
871
- private static final String FORMAT = "%s %s %02d %02d:%02d:%02d %d" ;
872
870
static final String [] WDAY_NAME = new String []{
873
871
"Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" , "Sun"
874
872
};
@@ -892,7 +890,7 @@ public String localtime(PTuple time,
892
890
}
893
891
894
892
protected static String format (int [] tm ) {
895
- return format (FORMAT , tm );
893
+ return format (CTIME_FORMAT , tm );
896
894
}
897
895
898
896
@ TruffleBoundary
0 commit comments