Skip to content

Commit 94a4c51

Browse files
mroeschkepmhatre1
authored andcommitted
PERF: Remove slower short circut checks in RangeIndex__getitem__ (pandas-dev#57856)
1 parent cbd15ce commit 94a4c51

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

pandas/core/indexes/range.py

-5
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,6 @@ def __getitem__(self, key):
11531153
else:
11541154
key = np.asarray(key, dtype=bool)
11551155
check_array_indexer(self._range, key) # type: ignore[arg-type]
1156-
# Short circuit potential _shallow_copy check
1157-
if key.all():
1158-
return self._simple_new(self._range, name=self.name)
1159-
elif not key.any():
1160-
return self._simple_new(_empty_range, name=self.name)
11611156
key = np.flatnonzero(key)
11621157
try:
11631158
return self.take(key)

0 commit comments

Comments
 (0)