Skip to content

Commit 311aa3c

Browse files
Don't call unicode_get_empty() directly; remove some unneeded assignments
1 parent 1a29140 commit 311aa3c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Objects/unicodeobject.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14674,7 +14674,7 @@ unicode_vectorcall(PyObject *type, PyObject *const *args,
1467414674
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
1467514675
Py_ssize_t nkwargs = (kwnames) ? PyTuple_GET_SIZE(kwnames) : 0;
1467614676
if (nargs == 0 && nkwargs == 0) {
14677-
return unicode_get_empty();
14677+
return unicode_new_impl(_PyType_CAST(type), NULL, NULL, NULL);
1467814678
}
1467914679
PyObject *object = args[0];
1468014680
if (nargs == 1 && nkwargs == 0) {
@@ -14712,7 +14712,6 @@ unicode_vectorcall(PyObject *type, PyObject *const *args,
1471214712
else {
1471314713
return fallback_to_tp_call(type, nargs, nkwargs, args, kwnames);
1471414714
}
14715-
PyObject *object = args[0];
1471614715
return unicode_new_impl(_PyType_CAST(type), object, encoding, errors);
1471714716
}
1471814717
if (nargs + nkwargs == 3) {
@@ -14727,7 +14726,6 @@ unicode_vectorcall(PyObject *type, PyObject *const *args,
1472714726
else if (nkwargs != 0) {
1472814727
return fallback_to_tp_call(type, nargs, nkwargs, args, kwnames);
1472914728
}
14730-
PyObject *object = args[0];
1473114729
const char *encoding = as_const_char(args[1], "encoding");
1473214730
if (encoding == NULL) {
1473314731
return NULL;

0 commit comments

Comments
 (0)