Skip to content

Commit

Permalink
Merge pull request #37 from Klebert-Engineering/hotfix-infinite-loop
Browse files Browse the repository at this point in the history
Fixed infinite loop.
  • Loading branch information
MisterGC committed Sep 28, 2023
2 parents e766a2e + 8bc34bb commit 72f050d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions libs/model/src/featurelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,17 @@ bool TileFeatureLayer::validFeatureId(
KeyValuePairs const& featureIdParts,
bool includeTilePrefix) {

auto typesIterator = this->layerInfo_->featureTypes_.begin();
while (typesIterator != this->layerInfo_->featureTypes_.end()) {
auto& type = *typesIterator;
if (type.name_ == typeId) {
auto typeIt = this->layerInfo_->featureTypes_.begin();
while (typeIt != this->layerInfo_->featureTypes_.end()) {
if (typeIt->name_ == typeId)
break;
}
++typeIt;
}
if (typesIterator == this->layerInfo_->featureTypes_.end()) {
if (typeIt == this->layerInfo_->featureTypes_.end()) {
throw logRuntimeError(stx::format("Could not find feature type {}", typeId));
}

for (auto& candidateComposition : typesIterator->uniqueIdCompositions_) {
for (auto& candidateComposition : typeIt->uniqueIdCompositions_) {
uint32_t compositionMatchStartIndex = 0;
if (includeTilePrefix && this->featureIdPrefix().has_value()) {
// Iterate past the prefix in the unique id composition.
Expand Down

0 comments on commit 72f050d

Please sign in to comment.