mirror of
https://github.com/python/cpython.git
synced 2025-10-22 17:33:55 +00:00
gh-131798: Optimize _UNARY_NEGATIVE
(GH-135223)
This commit is contained in:
parent
569fc6870f
commit
bda121862e
4 changed files with 33 additions and 2 deletions
|
@ -452,7 +452,13 @@ dummy_func(void) {
|
|||
res = sym_new_compact_int(ctx);
|
||||
}
|
||||
else {
|
||||
res = sym_new_not_null(ctx);
|
||||
PyTypeObject *type = sym_get_type(value);
|
||||
if (type == &PyLong_Type || type == &PyFloat_Type) {
|
||||
res = sym_new_type(ctx, type);
|
||||
}
|
||||
else {
|
||||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue