mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-45885: Specialize COMPARE_OP (GH-29734)
* Add COMPARE_OP_ADAPTIVE adaptive instruction. * Add COMPARE_OP_FLOAT_JUMP, COMPARE_OP_INT_JUMP and COMPARE_OP_STR_JUMP specialized instructions. * Introduce and use _PyUnicode_Equal
This commit is contained in:
parent
99fcf15052
commit
03768c4d13
9 changed files with 289 additions and 60 deletions
|
@ -11168,6 +11168,20 @@ unicode_compare_eq(PyObject *str1, PyObject *str2)
|
|||
return (cmp == 0);
|
||||
}
|
||||
|
||||
int
|
||||
_PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
{
|
||||
assert(PyUnicode_CheckExact(str1));
|
||||
assert(PyUnicode_CheckExact(str2));
|
||||
if (str1 == str2) {
|
||||
return 1;
|
||||
}
|
||||
if (PyUnicode_READY(str1) || PyUnicode_READY(str2)) {
|
||||
return -1;
|
||||
}
|
||||
return unicode_compare_eq(str1, str2);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicode_Compare(PyObject *left, PyObject *right)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue