Skip to content

Commit 818c24f

Browse files
committed
add _dec_mpd_radix()
1 parent 7a9fac1 commit 818c24f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Modules/_decimal/_decimal.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,12 +4433,11 @@ dec_conjugate(PyObject *self, PyObject *Py_UNUSED(dummy))
44334433
return Py_NewRef(self);
44344434
}
44354435

4436-
static PyObject *
4437-
dec_mpd_radix(PyObject *self, PyObject *Py_UNUSED(dummy))
4436+
static inline PyObject *
4437+
_dec_mpd_radix(decimal_state *state)
44384438
{
44394439
PyObject *result;
44404440

4441-
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
44424441
result = dec_alloc(state);
44434442
if (result == NULL) {
44444443
return NULL;
@@ -4448,6 +4447,13 @@ dec_mpd_radix(PyObject *self, PyObject *Py_UNUSED(dummy))
44484447
return result;
44494448
}
44504449

4450+
static PyObject *
4451+
dec_mpd_radix(PyObject *self, PyObject *Py_UNUSED(dummy))
4452+
{
4453+
decimal_state *state = get_module_state_by_def(Py_TYPE(self));
4454+
return _dec_mpd_radix(state);
4455+
}
4456+
44514457
static PyObject *
44524458
dec_mpd_qcopy_abs(PyObject *self, PyObject *Py_UNUSED(dummy))
44534459
{
@@ -5403,7 +5409,8 @@ DecCtx_TernaryFunc(mpd_qfma)
54035409
static PyObject *
54045410
ctx_mpd_radix(PyObject *context, PyObject *dummy)
54055411
{
5406-
return dec_mpd_radix(context, dummy);
5412+
decimal_state *state = get_module_state_from_ctx(context);
5413+
return _dec_mpd_radix(state);
54075414
}
54085415

54095416
/* Boolean functions: single decimal argument */

0 commit comments

Comments
 (0)