1
0
Fork 0

Avoid copying SGShared<FGTaxiNode> in ground-net

This makes some common iterations in the AI traffic code faster,
since there is no thrashing of the atomic operations.
This commit is contained in:
James Turner 2019-03-03 12:12:03 +00:00
parent 87f63c4cec
commit 1183d282ae

View file

@ -417,11 +417,11 @@ void FGGroundNetwork::blockSegmentsEndingAt(FGTaxiSegment *seg, int blockId, tim
if (!seg)
throw sg_exception("Passed invalid segment");
FGTaxiNode *node = seg->getEnd();
const FGTaxiNode *node = seg->endNode;
FGTaxiSegmentVector::iterator tsi;
for ( tsi = segments.begin(); tsi != segments.end(); tsi++) {
FGTaxiSegment* otherSegment = *tsi;
if ((otherSegment->getEnd() == node) && (otherSegment != seg)) {
if ((otherSegment->endNode == node) && (otherSegment != seg)) {
otherSegment->block(blockId, blockTime, now);
}
}