Skip to content

Commit 9da1b9d

Browse files
refactor it a bit
1 parent d18afa0 commit 9da1b9d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Python/optimizer_bytecodes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,7 @@ dummy_func(void) {
16821682
}
16831683

16841684
op(_LOAD_SPECIAL, (method_and_self[2] -- method_and_self[2])) {
1685+
bool optimized = false;
16851686
PyTypeObject *type = sym_get_probable_type(method_and_self[1]);
16861687
if (type != NULL) {
16871688
PyObject *name = _Py_SpecialMethods[oparg].name;
@@ -1699,9 +1700,10 @@ dummy_func(void) {
16991700
_Py_BloomFilter_Add(dependencies, type);
17001701
}
17011702
method_and_self[0] = sym_new_const(ctx, descr);
1703+
optimized = true;
17021704
}
17031705
}
1704-
else {
1706+
if (!optimized) {
17051707
method_and_self[0] = sym_new_not_null(ctx);
17061708
method_and_self[1] = sym_new_unknown(ctx);
17071709
}

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)