[pypy-commit] extradoc extradoc: use pixel iterator here aswell

hakanardo noreply at buildbot.pypy.org
Thu Sep 13 17:24:58 CEST 2012


Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r4810:e2ccec1d0795
Date: 2012-09-13 17:24 +0200
http://bitbucket.org/pypy/extradoc/changeset/e2ccec1d0795/

Log:	use pixel iterator here aswell

diff --git a/talk/dls2012/demo/image.py b/talk/dls2012/demo/image.py
--- a/talk/dls2012/demo/image.py
+++ b/talk/dls2012/demo/image.py
@@ -8,9 +8,8 @@
             b = ConstantImage(a.width, a.height, b)
 
         out = a.new(typecode='d')
-        for y in xrange(a.height):
-            for x in xrange(a.width):
-                out[x, y] = op(float(a[x, y]), float(b[x, y]))
+        for x, y in a.indexes():
+            out[x, y] = op(float(a[x, y]), float(b[x, y]))
 
         return out
     return f


More information about the pypy-commit mailing list