aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Kearns <bdkearns@gmail.com>2014-05-04 13:32:17 -0400
committerBrian Kearns <bdkearns@gmail.com>2014-05-04 13:32:17 -0400
commit01fd39ebd34fe8afcd4abf1ca881178636175bf1 (patch)
tree2893d74aa982b299242c9536c7488b8c7d9c62c3
parentremove loop from StringBuffer.getslice (diff)
downloadpypy-01fd39ebd34fe8afcd4abf1ca881178636175bf1.tar.gz
pypy-01fd39ebd34fe8afcd4abf1ca881178636175bf1.tar.bz2
pypy-01fd39ebd34fe8afcd4abf1ca881178636175bf1.zip
no need to calculate this
-rw-r--r--pypy/module/struct/formatiterator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pypy/module/struct/formatiterator.py b/pypy/module/struct/formatiterator.py
index c59d0eeb3a..fbf448f8b4 100644
--- a/pypy/module/struct/formatiterator.py
+++ b/pypy/module/struct/formatiterator.py
@@ -133,7 +133,7 @@ class UnpackFormatIterator(FormatIterator):
end = self.pos + count
if end > self.length:
raise StructError("unpack str size too short for format")
- s = self.buf.getslice(self.pos, end, 1, end - self.pos)
+ s = self.buf.getslice(self.pos, end, 1, count)
self.pos = end
return s