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 | fd663130231a49d65788e4d1a32d8e92f6f700da (patch) | |
tree | bac1219ac96c5f5c5c8b1d4bf07c25c30e527927 /Parser/tokenizer.c | |
parent | fff0d245b37a7c142d560430f707db92447b5bd6 (diff) | |
download | cpython-fd663130231a49d65788e4d1a32d8e92f6f700da.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 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 3c8258832e..b0d9b80c32 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -711,7 +711,9 @@ tok_stdin_decode(struct tok_state *tok, char **inp) if (utf8 == NULL) goto error_clear; - converted = new_string(PyString_AsString(utf8), PyString_Size(utf8)); + assert(PyString_Check(utf8)); + converted = new_string(PyString_AS_STRING(utf8), + PyString_GET_SIZE(utf8)); Py_DECREF(utf8); if (converted == NULL) goto error_nomem; |