Skip to content

Commit 13b065f

Browse files
authored
Move up a function
1 parent 07ca91f commit 13b065f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Modules/_datetimemodule.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7271,6 +7271,15 @@ get_const_us_per_minute(datetime_state *st) {
72717271
: PyLong_FromLong(60000000);
72727272
}
72737273

7274+
static inline PyObject *
7275+
get_const_sec_per_day(datetime_state *st) {
7276+
return st && st->seconds_per_day ? Py_NewRef(st->seconds_per_day)
7277+
: PyLong_FromLong(24 * 3600);
7278+
}
7279+
7280+
/* The rest are too big for 32-bit ints, but even
7281+
* us_per_week fits in 40 bits, so doubles should be exact.
7282+
*/
72747283
static inline PyObject *
72757284
get_const_us_per_hour(datetime_state *st) {
72767285
return st && st->us_per_hour ? Py_NewRef(st->us_per_hour)
@@ -7289,11 +7298,6 @@ get_const_us_per_week(datetime_state *st) {
72897298
: PyLong_FromDouble(604800000000.0);
72907299
}
72917300

7292-
static inline PyObject *
7293-
get_const_sec_per_day(datetime_state *st) {
7294-
return st && st->seconds_per_day ? Py_NewRef(st->seconds_per_day)
7295-
: PyLong_FromLong(24 * 3600);
7296-
}
72977301

72987302
static inline PyObject *
72997303
get_const_epoch(datetime_state *st) {

0 commit comments

Comments
 (0)