diff options
| author | rakiru <rabbitkillrun@googlemail.com> | 2018-01-11 19:19:58 +0000 |
|---|---|---|
| committer | rakiru <rabbitkillrun@googlemail.com> | 2018-01-11 19:19:58 +0000 |
| commit | 6f0e48eac4f20894c802c93ac75cfa4693fbaa36 (patch) | |
| tree | 9c32ae6716393d3aa7ccbb14a41494efe34d2399 /asciifarm/client/display | |
| parent | e0164e21209cec0ec24e9d25eee90711bca78947 (diff) | |
Replace None equality checks with identity checks
Both work, but the identity check is the more correct/idiomatic
approach (and also ever-so-slightly more efficient).
Diffstat (limited to 'asciifarm/client/display')
| -rw-r--r-- | asciifarm/client/display/fieldpad.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/asciifarm/client/display/fieldpad.py b/asciifarm/client/display/fieldpad.py index 6619c1f..f64634e 100644 --- a/asciifarm/client/display/fieldpad.py +++ b/asciifarm/client/display/fieldpad.py @@ -29,14 +29,14 @@ class FieldPad: def changeCell(self, x, y, sprites): """ sprites must always have at least one element """ char, colour, bgcolour = sprites[0] - if bgcolour == None: + if bgcolour is None: for (ch, co, bg) in sprites: - if bg != None: + if bg is not None: bgcolour = bg break else: bgcolour = 0 - if colour != None and self.colours: + if colour is not None and self.colours: self.pad.addstr(y, x*self.charSize, char, self.colours.get(colour, bgcolour)) else: self.pad.addstr(y, x*self.charSize, char) |
