Revert "bt2: _EventConst.__getitem__(): use a single temporary variable"
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 8 Apr 2020 17:05:55 +0000 (13:05 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 9 Apr 2020 18:33:32 +0000 (14:33 -0400)
I did not want to merge this and pressed the wrong button on Gerrit.

Sorry.

Change-Id: I11cc739c126131560ba31d2a1f3f01b7e961a837
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3354
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>

src/bindings/python/bt2/bt2/event.py

index e18f12cf5f965d24f78184cfc96dc30a3091c5d5..6a6c1185987517c8c930e32b0b545e19b0daf5a8 100644 (file)
@@ -108,26 +108,26 @@ class _EventConst(object._UniqueObject):
 
     def __getitem__(self, key):
         utils._check_str(key)
-        root_field = self.payload_field
+        payload_field = self.payload_field
 
-        if root_field is not None and key in root_field:
-            return root_field[key]
+        if payload_field is not None and key in payload_field:
+            return payload_field[key]
 
-        root_field = self.specific_context_field
+        specific_context_field = self.specific_context_field
 
-        if root_field is not None and key in root_field:
-            return root_field[key]
+        if specific_context_field is not None and key in specific_context_field:
+            return specific_context_field[key]
 
-        root_field = self.common_context_field
+        common_context_field = self.common_context_field
 
-        if root_field is not None and key in root_field:
-            return root_field[key]
+        if common_context_field is not None and key in common_context_field:
+            return common_context_field[key]
 
         if self.packet:
-            root_field = self.packet.context_field
+            packet_context_field = self.packet.context_field
 
-            if root_field is not None and key in root_field:
-                return root_field[key]
+            if packet_context_field is not None and key in packet_context_field:
+                return packet_context_field[key]
 
         raise KeyError(key)
 
This page took 0.026125 seconds and 4 git commands to generate.