fix: [stix2 export] Faster tags handling function

- Compressed the function, removing some useless
  lines / variables
pull/4037/head
chrisr3d 2019-01-19 23:09:52 +01:00
parent ced9145824
commit a49b70a162
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 1 additions and 5 deletions

View File

@ -718,11 +718,7 @@ class StixBuilder():
return "Undefined name"
def handle_tags(self, tags):
markings = []
for tag in tags:
tag_name = tag['name']
markings.append(self.markings[tag_name]['id'] if tag_name in self.markings else self.create_marking(tag_name))
return markings
return [self.markings[tag]['id'] if tag in self.markings else self.create_marking(tag) for tag in tags]
def resolve_asn_observable(self, attributes, object_id):
asn = objectsMapping['asn']['observable']