Skip to content

Commit 0b38cd9

Browse files
Comment improvements
1 parent 3fdc9e7 commit 0b38cd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/codeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,14 +2109,15 @@ code_returns_only_none(PyCodeObject *co)
21092109
// None wasn't there, which means there was no implicit return,
21102110
// "return", or "return None".
21112111

2112-
// The last instruction mostly either returns or raises.
2112+
// The last instruction of a function often equals to "return X".
21132113
// We can take advantage of that for a quick exit.
21142114
_Py_CODEUNIT final = _Py_GetBaseCodeUnit(co, len-1);
21152115
if (IS_RETURN_OPCODE(final.op.code)) {
21162116
// It was an explicit return (non-None).
21172117
return 0;
21182118
}
21192119

2120+
// There is no need of value checking in this case.
21202121
none_index = -1;
21212122
}
21222123

0 commit comments

Comments
 (0)