Skip to content

Commit

Permalink
Totally avoid any kind of copy
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored Oct 26, 2022
1 parent 48334c6 commit b528234
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xarray/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,11 @@ def reindex_all(self) -> None:
def align(self) -> None:
if not self.indexes and len(self.objects) == 1:
# fast path for the trivial case
(obj,) = self.objects
self.results = (obj.copy(deep=self.copy),)
if self.copy:
(obj,) = self.objects
self.results = (obj.copy(deep=True),)
else:
self.results = self.objects
return

self.find_matching_indexes()
Expand Down

0 comments on commit b528234

Please sign in to comment.