diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-19 23:34:44 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-19 23:34:44 (GMT) |
commit | 7fbac45287e13cf721f363614f699ffcfbcee2af (patch) | |
tree | 195177d4e165262ccb4d06e0755ca8cf32566fd1 | |
parent | c3ccaae6f3469716a7084fb2f5a34cba90b39ee6 (diff) | |
download | cpython-7fbac45287e13cf721f363614f699ffcfbcee2af.zip cpython-7fbac45287e13cf721f363614f699ffcfbcee2af.tar.gz cpython-7fbac45287e13cf721f363614f699ffcfbcee2af.tar.bz2 |
_elementtree: deepcopy() now uses fast call
Issue #27128.
-rw-r--r-- | Modules/_elementtree.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index b32f2ad..5d124b3 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -819,9 +819,8 @@ LOCAL(PyObject *) deepcopy(PyObject *object, PyObject *memo) { /* do a deep copy of the given object */ - PyObject *args; - PyObject *result; elementtreestate *st; + PyObject *stack[2]; /* Fast paths */ if (object == Py_None || PyUnicode_CheckExact(object)) { @@ -857,12 +856,9 @@ deepcopy(PyObject *object, PyObject *memo) return NULL; } - args = PyTuple_Pack(2, object, memo); - if (!args) - return NULL; - result = PyObject_CallObject(st->deepcopy_obj, args); - Py_DECREF(args); - return result; + stack[0] = object; + stack[1] = memo; + return _PyObject_FastCall(st->deepcopy_obj, stack, 2, NULL); } |