Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r78655:1c1bafcc37b9
Date: 2015-07-24 14:58 +0200
http://bitbucket.org/pypy/pypy/changeset/1c1bafcc37b9/
Log: since we're read only, don't do a copy when we don't have to
diff --git a/rpython/rlib/buffer.py b/rpython/rlib/buffer.py
--- a/rpython/rlib/buffer.py
+++ b/rpython/rlib/buffer.py
@@ -74,6 +74,8 @@
return ""
if step == 1:
assert 0 <= start <= stop
+ if start == 0 and stop == len(self.value):
+ return self.value
return self.value[start:stop]
return Buffer.getslice(self, start, stop, step, size)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit