Skip to content

Commit 0a96b3a

Browse files
committed
Simplify code
1 parent 3138c77 commit 0a96b3a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Python/optimizer_bytecodes.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,10 +856,9 @@ dummy_func(void) {
856856
}
857857

858858
op(_CALL_STR_1, (unused, unused, arg -- res)) {
859-
if (sym_matches_type(arg, &PyUnicode_Type) && sym_is_const(ctx, arg)) {
860-
// e.g. str('foo') or str(foo) where foo is known to be a string const
861-
PyObject *value = sym_get_const(ctx, arg);
862-
res = sym_new_const(ctx, value);
859+
if (sym_matches_type(arg, &PyUnicode_Type)) {
860+
// e.g. str('foo') or str(foo) where foo is known to be a string
861+
res = arg;
863862
}
864863
else {
865864
res = sym_new_type(ctx, &PyUnicode_Type);

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)