Skip to content

Commit

Permalink
Avoid explicit loop when updating OrderedSet (#7857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan authored May 25, 2023
1 parent fd0ac3e commit 95bb813
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xarray/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ def discard(self, value: T) -> None:
# Additional methods

def update(self, values: Iterable[T]) -> None:
for v in values:
self._d[v] = None
self._d.update(dict.fromkeys(values))

def __repr__(self) -> str:
return f"{type(self).__name__}({list(self)!r})"
Expand Down

0 comments on commit 95bb813

Please sign in to comment.