diff options
author | Sjoerd Mullender <sjoerd@acm.org> | 1993-10-22 12:04:32 (GMT) |
---|---|---|
committer | Sjoerd Mullender <sjoerd@acm.org> | 1993-10-22 12:04:32 (GMT) |
commit | 3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e (patch) | |
tree | cb9c4f6b18f70822ade606f269fc043be542f5da /Objects/classobject.c | |
parent | a75d306e2b799aa891666899ca973bec82b2362b (diff) | |
download | cpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.zip cpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.tar.gz cpython-3bb8a05947fb67ed827dd1e8d7c0a982a1ff989e.tar.bz2 |
Several optimizations and speed improvements.
cstubs: Use Matrix type instead of float[4][4].
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index c0eb8f1..6008999 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -355,13 +355,15 @@ instance_getattr(inst, name) { register object *v; classobject *class; - if (strcmp(name, "__dict__") == 0) { - INCREF(inst->in_dict); - return inst->in_dict; - } - if (strcmp(name, "__class__") == 0) { - INCREF(inst->in_class); - return (object *)inst->in_class; + if (name[0] == '_' && name[1] == '_') { + if (strcmp(name, "__dict__") == 0) { + INCREF(inst->in_dict); + return inst->in_dict; + } + if (strcmp(name, "__class__") == 0) { + INCREF(inst->in_class); + return (object *)inst->in_class; + } } class = NULL; v = dictlookup(inst->in_dict, name); |