[Python-checkins] cpython: pattern_subx() now uses fast call

victor.stinner python-checkins at python.org
Fri Aug 19 19:50:45 EDT 2016


https://hg.python.org/cpython/rev/2954d2aa4c90
changeset:   102788:2954d2aa4c90
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Aug 20 01:38:00 2016 +0200
summary:
  pattern_subx() now uses fast call

Issue #27128.

files:
  Modules/_sre.c |  9 +--------
  1 files changed, 1 insertions(+), 8 deletions(-)


diff --git a/Modules/_sre.c b/Modules/_sre.c
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -1056,7 +1056,6 @@
     PyObject* joiner;
     PyObject* item;
     PyObject* filter;
-    PyObject* args;
     PyObject* match;
     void* ptr;
     Py_ssize_t status;
@@ -1158,13 +1157,7 @@
             match = pattern_new_match(self, &state, 1);
             if (!match)
                 goto error;
-            args = PyTuple_Pack(1, match);
-            if (!args) {
-                Py_DECREF(match);
-                goto error;
-            }
-            item = PyObject_CallObject(filter, args);
-            Py_DECREF(args);
+            item = _PyObject_FastCall(filter, &match, 1, NULL);
             Py_DECREF(match);
             if (!item)
                 goto error;

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list