More efficient regex usage

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Jonathan Shimwell 2022-06-22 22:45:37 +02:00 committed by GitHub
parent 839c0fe81b
commit c2018c41fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -420,8 +420,7 @@ class Material(IDManagerMixin):
# If the Material contains the element, delete it
for nuc in reversed(self.nuclides):
element_name = re.split(r'(\d+)', nuc.name)[0]
print(element_name, element)
element_name = re.split(r'\d+', nuc.name)[0]
if element_name == element:
self.nuclides.remove(nuc)