Skip to content

Commit

Permalink
Add explanations for c++ complexity in RelateGeometry::extractSegment…
Browse files Browse the repository at this point in the history
…Strings;
  • Loading branch information
pramsey committed Aug 12, 2024
1 parent bc3e7ce commit ec6423c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/operation/relateng/RelateGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ RelateGeometry::extractSegmentStrings(bool isA, const Envelope* env)
{
std::vector<const SegmentString*> segStrings;

// When we get called in the context of a prepared geometry
// geomA might already have segments extracted and stored,
// so check and reuse them if possible
if (isA && isPrepared() && env == nullptr) {
if (segStringPermStore.empty()) {
extractSegmentStrings(isA, env, geom, segStrings, segStringPermStore);
Expand All @@ -375,6 +378,9 @@ RelateGeometry::extractSegmentStrings(bool isA, const Envelope* env)
}
}
}
// In the context of geomB we always extract for each call,
// and same goes for geomA when not in prepared mode, or when
// using an envelope filter.
else {
segStringTempStore.clear();
extractSegmentStrings(isA, env, geom, segStrings, segStringTempStore);
Expand Down

0 comments on commit ec6423c

Please sign in to comment.