Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Mar 4, 2022
1 parent 52c2019 commit 113b65f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions rtree/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,9 @@ def __and__(self, other: Index) -> Index:
i = 0
new_idx = Index(interleaved=self.interleaved, properties=self.properties)

if self.interleaved:
# For each Item in self...
for item1 in self.intersection(self.bounds, objects=True):
# For each Item in self...
for item1 in self.intersection(self.bounds, objects=True):
if self.interleaved:
# For each Item in other that intersects...
for item2 in other.intersection(item1.bbox, objects=True):
# Compute the intersection bounding box
Expand All @@ -692,9 +692,7 @@ def __and__(self, other: Index) -> Index:
new_idx.insert(i, bbox, (item1.object, item2.object))
i += 1

else:
# For each Item in self...
for item1 in self.intersection(self.bounds, objects=True):
else:
# For each Item in other that intersects...
for item2 in other.intersection(item1.bounds, objects=True):
# Compute the intersection bounding box
Expand Down

0 comments on commit 113b65f

Please sign in to comment.