diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-12 10:06:48 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 71cffad863f89d1d53115bb3af36c0d0cf70ce6a (patch) | |
tree | 9a17e559b5b48bc8e91897543533668beeba699d | |
parent | 97b8ab7db332fd703821aa771e4c7a310da343c0 (diff) | |
download | buildstream-71cffad863f89d1d53115bb3af36c0d0cf70ce6a.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() # |