[pypy-commit] lang-smalltalk default: simplify logic slightly
cfbolz
noreply at buildbot.pypy.org
Wed Feb 20 15:57:22 CET 2013
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch:
Changeset: r69:fd4d9700e7b6
Date: 2013-02-19 16:55 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/fd4d9700e7b6/
Log: simplify logic slightly
diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -308,10 +308,9 @@
@objectmodel.specialize.arg(2)
def as_special_get_shadow(self, space, TheClass):
shadow = self._shadow
- if shadow is None:
- shadow = self.attach_shadow_of_class(space, TheClass)
- elif not isinstance(shadow, TheClass):
- shadow.detach_shadow()
+ if not isinstance(shadow, TheClass):
+ if shadow is not None:
+ shadow.detach_shadow()
shadow = self.attach_shadow_of_class(space, TheClass)
shadow.sync_shadow()
return shadow
More information about the pypy-commit
mailing list