Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
c0dded1d
Commit
c0dded1d
authored
Feb 15, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce code overhead in some utility functions
parent
ab2454fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+6
-17
No files found.
Cython/Utility/Optimize.c
View file @
c0dded1d
...
...
@@ -10,12 +10,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
Py_INCREF
(
Py_None
);
return
Py_None
;
/* this is just to have an accurate signature */
}
else
{
PyObject
*
r
,
*
m
;
m
=
PyObject_GetAttr
(
L
,
PYIDENT
(
"append"
));
if
(
!
m
)
return
NULL
;
r
=
PyObject_CallFunctionObjArgs
(
m
,
x
,
NULL
);
Py_DECREF
(
m
);
return
r
;
return
PyObject_CallMethodObjArgs
(
L
,
PYIDENT
(
"append"
),
x
,
NULL
);
}
}
...
...
@@ -289,12 +284,10 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec
}
Py_INCREF
(
value
);
}
else
{
PyObject
*
m
;
m
=
PyObject_GetAttr
(
d
,
PYIDENT
(
"get"
));
if
(
!
m
)
return
NULL
;
value
=
PyObject_CallFunctionObjArgs
(
m
,
key
,
(
default_value
==
Py_None
)
?
NULL
:
default_value
,
NULL
);
Py_DECREF
(
m
);
if
(
default_value
==
Py_None
)
default_value
=
NULL
;
value
=
PyObject_CallMethodObjArgs
(
d
,
PYIDENT
(
"get"
),
key
,
default_value
,
NULL
);
}
#endif
return
value
;
...
...
@@ -330,11 +323,7 @@ static PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *d
}
Py_INCREF
(
value
);
}
else
{
PyObject
*
m
;
m
=
PyObject_GetAttr
(
d
,
PYIDENT
(
"setdefault"
));
if
(
!
m
)
return
NULL
;
value
=
PyObject_CallFunctionObjArgs
(
m
,
key
,
default_value
,
NULL
);
Py_DECREF
(
m
);
value
=
PyObject_CallMethodObjArgs
(
d
,
PYIDENT
(
"setdefault"
),
key
,
default_value
,
NULL
);
}
#endif
return
value
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment