Skip to content

Commit 68eed5e

Browse files
committed
better type lookups
1 parent 161bad9 commit 68eed5e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Python/optimizer_bytecodes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,9 @@ dummy_func(void) {
468468
}
469469

470470
op(_UNARY_NEGATIVE, (value -- res)) {
471-
if (sym_matches_type(value, &PyLong_Type) || sym_matches_type(value, &PyFloat_Type)) {
472-
res = sym_new_type(ctx, sym_get_type(value));
471+
PyTypeObject *type = sym_get_type(value);
472+
if (type == &PyLong_Type || type == &PyFloat_Type) {
473+
res = sym_new_type(ctx, type);
473474
}
474475
else {
475476
res = sym_new_not_null(ctx);

Python/optimizer_cases.c.h

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)