diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-03-14 00:27:28 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-03-14 00:27:28 +0100 |
commit | 010e34e40a8eaf142e8393eab6f29a467fe8fa92 (patch) | |
tree | 14e2bb37e6fa3223eebd531d7cdee709f20492e4 | |
parent | dc3f3236bb4da41a1ac47786ff9333f9a620cc89 (diff) | |
download | pysnmp-git-010e34e40a8eaf142e8393eab6f29a467fe8fa92.tar.gz |
more efficient getOidVal
-rw-r--r-- | pysnmp/proto/api/v1.py | 5 |
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): |