Merge pull request #256 from gtsoul-tech/bug/cppcheckErrors

Bug/cppcheck errors (3 ,4 ,7 ,10,11) WIP
This commit is contained in:
Konstantinos Margaritis
2024-04-25 10:17:23 +03:00
committed by GitHub
11 changed files with 32 additions and 35 deletions

View File

@@ -165,9 +165,9 @@ void reformAnchoredRepeatsComponent(NGHolder &g,
return;
}
NFAVertex dotV = NGHolder::null_vertex();
set<NFAVertex> otherV;
dotV = findReformable(g, compAnchoredStarts, otherV);
NFAVertex dotV = findReformable(g, compAnchoredStarts, otherV);
if (dotV == NGHolder::null_vertex()) {
DEBUG_PRINTF("no candidate reformable dot found.\n");
return;
@@ -268,9 +268,9 @@ void reformUnanchoredRepeatsComponent(NGHolder &g,
}
while (true) {
NFAVertex dotV = NGHolder::null_vertex();
set<NFAVertex> otherV;
dotV = findReformable(g, compUnanchoredStarts, otherV);
NFAVertex dotV = findReformable(g, compUnanchoredStarts, otherV);
if (dotV == NGHolder::null_vertex()) {
DEBUG_PRINTF("no candidate reformable dot found.\n");
return;

View File

@@ -1292,8 +1292,8 @@ bool doTreePlanningIntl(NGHolder &g,
DEBUG_PRINTF("add mapped reporters for region %u\n", it->first);
addMappedReporterVertices(it->second, g, copy_to_orig,
plan.back().reporters);
} while (it->second.optional && it != info.rend() &&
(++it)->first > furthest->first);
} while (it != info.rend() && it->second.optional &&
(++it)->first > furthest->first);
return true;
}
@@ -1551,7 +1551,7 @@ bool doSomPlanning(NGHolder &g, bool stuck_in,
DEBUG_PRINTF("region %u contributes reporters to last plan\n",
it->first);
addReporterVertices(it->second, g, plan.back().reporters);
} while (it->second.optional && it != info.rend() &&
} while (it != info.rend() && it->second.optional &&
(++it)->first > furthest->first);
DEBUG_PRINTF("done!\n");