Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea5e599

Browse files
committed
pattern_subx() now uses fast call
Issue #27128.
1 parent 7fbac45 commit ea5e599

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

Modules/_sre.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,6 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
10561056
PyObject* joiner;
10571057
PyObject* item;
10581058
PyObject* filter;
1059-
PyObject* args;
10601059
PyObject* match;
10611060
void* ptr;
10621061
Py_ssize_t status;
@@ -1158,13 +1157,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
11581157
match = pattern_new_match(self, &state, 1);
11591158
if (!match)
11601159
goto error;
1161-
args = PyTuple_Pack(1, match);
1162-
if (!args) {
1163-
Py_DECREF(match);
1164-
goto error;
1165-
}
1166-
item = PyObject_CallObject(filter, args);
1167-
Py_DECREF(args);
1160+
item = _PyObject_FastCall(filter, &match, 1, NULL);
11681161
Py_DECREF(match);
11691162
if (!item)
11701163
goto error;

0 commit comments

Comments
 (0)