summaryrefslogtreecommitdiff
path: root/pyasn1/codec/streaming.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-10-01 09:36:51 +0200
committerIlya Etingof <etingof@gmail.com>2019-10-01 09:36:51 +0200
commitcbd65b03b1c68eb42df11261d655d69cb7170ef3 (patch)
tree80a3fe5428d9e0192d754405dd30ed169ae85931 /pyasn1/codec/streaming.py
parent904ad0a2b6882b12ac5df1bed58beb2bc96422dc (diff)
downloadpyasn1-git-cbd65b03b1c68eb42df11261d655d69cb7170ef3.tar.gz
Optimize `streaming` objects access for performance
Diffstat (limited to 'pyasn1/codec/streaming.py')
-rw-r--r--pyasn1/codec/streaming.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pyasn1/codec/streaming.py b/pyasn1/codec/streaming.py
index 91446cd..65c318c 100644
--- a/pyasn1/codec/streaming.py
+++ b/pyasn1/codec/streaming.py
@@ -154,8 +154,8 @@ def isEndOfStream(substrate):
yield not received
-def peek(substrate, size=-1):
- """Peek the stream.
+def peekIntoStream(substrate, size=-1):
+ """Peek into stream.
Parameters
----------
@@ -183,14 +183,14 @@ def peek(substrate, size=-1):
else:
current_position = substrate.tell()
try:
- for chunk in read(substrate, size):
+ for chunk in readFromStream(substrate, size):
yield chunk
finally:
substrate.seek(current_position)
-def read(substrate, size=-1, context=None):
+def readFromStream(substrate, size=-1, context=None):
"""Read from the stream.
Parameters