diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-12 10:06:48 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-15 13:59:42 +0100 |
commit | e9b87b09fe01d8a69b66bd6a9e6fccc498115db8 (patch) | |
tree | 3c5adc80bb3b8b1f59aa9eceb81595c43b7af3a9 | |
parent | 627b0bc6614ee643799cc0033368f6caae5300ea (diff) | |
download | buildstream-e9b87b09fe01d8a69b66bd6a9e6fccc498115db8.tar.gz |
node: use 'pop' instead of 'del' for safe_del
This reduces slightly the amount of C code needed and makes the run
marginally faster
-rw-r--r-- | src/buildstream/node.pyx | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/buildstream/node.pyx b/src/buildstream/node.pyx index c49c88871..ca2782166 100644 --- a/src/buildstream/node.pyx +++ b/src/buildstream/node.pyx @@ -358,10 +358,7 @@ cdef class MappingNode(Node): return list(self.value.keys()) cpdef void safe_del(self, str key): - try: - del self.value[key] - except KeyError: - pass + self.value.pop(key, None) # validate_keys() # |