Skip to content
Snippets Groups Projects
Commit 12853ffe authored by Philipp Arras's avatar Philipp Arras
Browse files

MultiField: Simplify

parent 61b24b7d
No related branches found
No related tags found
1 merge request!695MultiField: Simplify
Pipeline #111945 passed
...@@ -273,12 +273,7 @@ class MultiField(Operator): ...@@ -273,12 +273,7 @@ class MultiField(Operator):
If a field is not present, it is assumed to have an uniform value If a field is not present, it is assumed to have an uniform value
of zero. of zero.
""" """
if self._domain is other._domain: return self.flexible_addsub(other, False)
return self + other
res = self.to_dict()
for key, val in other.items():
res[key] = res[key]+val if key in res else val
return MultiField.from_dict(res)
@staticmethod @staticmethod
def union(fields, domain=None): def union(fields, domain=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment