mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194)
Replace PyUnicode_New(0, 0), PyUnicode_FromString("") and PyUnicode_FromStringAndSize("", 0) with Py_GetConstant(Py_CONSTANT_EMPTY_STR).
This commit is contained in:
parent
6a39e96ab8
commit
b9a8ca0a6a
22 changed files with 35 additions and 35 deletions
|
@ -353,7 +353,7 @@ _stringio_readline(stringio *self, Py_ssize_t limit)
|
|||
|
||||
/* In case of overseek, return the empty string */
|
||||
if (self->pos >= self->string_size)
|
||||
return PyUnicode_New(0, 0);
|
||||
return Py_GetConstant(Py_CONSTANT_EMPTY_STR);
|
||||
|
||||
start = self->buf + self->pos;
|
||||
if (limit < 0 || limit > self->string_size - self->pos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue