diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-20 01:53:23 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-20 01:53:23 +0000 |
commit | 2aa9a5dfdd2966c57036dc836ba8e91ad47ecf14 (patch) | |
tree | 49688fd8e420b9a1625345de6593e147523b7b66 /Python/import.c | |
parent | 70f05c5d7f0259d056dbb19bc5632c8357fd6998 (diff) | |
download | cpython-git-2aa9a5dfdd2966c57036dc836ba8e91ad47ecf14.tar.gz |
Use macro versions instead of function versions when we already know the type.
This will hopefully get rid of some Coverity warnings, be a hint to
developers, and be marginally faster.
Some asserts were added when the type is currently known, but depends
on values from another function.
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c index 73051a2060..e58dbd5a1b 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1216,12 +1216,12 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, #endif if (!PyString_Check(v)) continue; - len = PyString_Size(v); + len = PyString_GET_SIZE(v); if (len + 2 + namelen + MAXSUFFIXSIZE >= buflen) { Py_XDECREF(copy); continue; /* Too long */ } - strcpy(buf, PyString_AsString(v)); + strcpy(buf, PyString_AS_STRING(v)); if (strlen(buf) != len) { Py_XDECREF(copy); continue; /* v contains '\0' */ |