Skip to content

Commit d8dbf84

Browse files
committed
Add a warning comment to the LOAD_GLOBAL inline code.
1 parent 3a4dfc8 commit d8dbf84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,9 +1710,11 @@ eval_frame(PyFrameObject *f)
17101710
case LOAD_GLOBAL:
17111711
w = GETITEM(names, oparg);
17121712
if (PyString_CheckExact(w)) {
1713+
/* Inline the PyDict_GetItem() calls.
1714+
WARNING: this is an extreme speed hack.
1715+
Do not try this at home. */
17131716
long hash = ((PyStringObject *)w)->ob_shash;
17141717
if (hash != -1) {
1715-
/* Inline the PyDict_GetItem() calls */
17161718
PyDictObject *d;
17171719
d = (PyDictObject *)(f->f_globals);
17181720
x = d->ma_lookup(d, w, hash)->me_value;

0 commit comments

Comments
 (0)