Skip to content

Commit

Permalink
avoid copy filecontainer (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathause authored Nov 7, 2024
1 parent 78c20cc commit c17e2fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions filefinder/_filefinder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import copy
import fnmatch
import glob
import logging
Expand Down Expand Up @@ -604,9 +603,8 @@ def __getitem__(self, key):
return element.name, element.to_dict()
# assume slice or [1]
else:
ret = copy.copy(self)
ret.df = self.df.iloc[key]
return ret
df = self.df.iloc[key]
return type(self)(df)

@property
def meta(self) -> list[dict[str, Any]]:
Expand Down

0 comments on commit c17e2fd

Please sign in to comment.