summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-03-14 00:27:28 +0100
committerIlya Etingof <etingof@gmail.com>2017-03-14 00:27:28 +0100
commit010e34e40a8eaf142e8393eab6f29a467fe8fa92 (patch)
tree14e2bb37e6fa3223eebd531d7cdee709f20492e4
parentdc3f3236bb4da41a1ac47786ff9333f9a620cc89 (diff)
downloadpysnmp-git-010e34e40a8eaf142e8393eab6f29a467fe8fa92.tar.gz
more efficient getOidVal
-rw-r--r--pysnmp/proto/api/v1.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pysnmp/proto/api/v1.py b/pysnmp/proto/api/v1.py
index 9b62f76a..a66355ef 100644
--- a/pysnmp/proto/api/v1.py
+++ b/pysnmp/proto/api/v1.py
@@ -116,10 +116,7 @@ class PDUAPI(object):
@staticmethod
def getVarBinds(pdu):
- varBinds = []
- for varBind in pdu.getComponentByPosition(3):
- varBinds.append(apiVarBind.getOIDVal(varBind))
- return varBinds
+ return [apiVarBind.getOIDVal(varBind) for varBind in pdu.getComponentByPosition(3)]
@staticmethod
def setVarBinds(pdu, varBinds):