Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r74797:e2e286fb7245 Date: 2014-12-03 15:03 -0500 http://bitbucket.org/pypy/pypy/changeset/e2e286fb7245/
Log: simplify setslice with no shape diff --git a/pypy/module/micronumpy/loop.py b/pypy/module/micronumpy/loop.py --- a/pypy/module/micronumpy/loop.py +++ b/pypy/module/micronumpy/loop.py @@ -89,17 +89,14 @@ def setslice(space, shape, target, source): if not shape: - # XXX - simplify - target_iter, target_state = target.create_iter(shape) - source_iter, source_state = source.create_iter(shape) dtype = target.dtype - val = source_iter.getitem(source_state) + val = source.getitem(source.start) if dtype.is_str_or_unicode(): val = dtype.coerce(space, val) else: val = val.convert_to(space, dtype) - target_iter.setitem(target_state, val) - return target + target.setitem(target.start, val) + return target return _setslice(space, shape, target, source) def _setslice(space, shape, target, source): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit