Author: Antonio Cuni <[email protected]>
Branch: faster-rstruct
Changeset: r80806:913f469cb07b
Date: 2015-11-20 16:27 +0100
http://bitbucket.org/pypy/pypy/changeset/913f469cb07b/
Log: adapt the applevel struct to the new interface for the fast path
diff --git a/pypy/module/struct/formatiterator.py
b/pypy/module/struct/formatiterator.py
--- a/pypy/module/struct/formatiterator.py
+++ b/pypy/module/struct/formatiterator.py
@@ -150,16 +150,13 @@
def appendobj(self, value):
self.result_w.append(self.space.wrap(value))
- def is_aligned(self, size):
- return self.pos % size == 0
+ def get_pos(self):
+ return self.pos
- def get_buffer(self):
+ def get_buffer_as_string_maybe(self):
# XXX: if self.buf is something different that StringBuffer, this has
# the effect to copy the whole string at each unpack!
return self.buf.as_str()
- def get_pos(self):
- return self.pos
-
- def advance(self, size):
+ def skip(self, size):
self.read(size) # XXX, could avoid taking the slice
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit