mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-31 17:26:12 +00:00
perf(companion): stop Locator target scan once TARGET_MAX is reached
buildTargets() kept iterating every contact after _targets filled up, doing a lookup + dedup pass per row with no effect (addPersonTarget already caps at TARGET_MAX). Bound the loop instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a67bf9e220
commit
fee2d32bd3
@@ -193,7 +193,7 @@ public:
|
|||||||
if (!c) continue;
|
if (!c) continue;
|
||||||
addPersonTarget(pre, c->name, /*require_position=*/false);
|
addPersonTarget(pre, c->name, /*require_position=*/false);
|
||||||
}
|
}
|
||||||
for (int idx = 0; ; idx++) {
|
for (int idx = 0; _target_n < TARGET_MAX; idx++) {
|
||||||
ContactInfo c;
|
ContactInfo c;
|
||||||
if (!the_mesh.getContactByIdx(idx, c)) break;
|
if (!the_mesh.getContactByIdx(idx, c)) break;
|
||||||
addPersonTarget(c.id.pub_key, c.name, /*require_position=*/true);
|
addPersonTarget(c.id.pub_key, c.name, /*require_position=*/true);
|
||||||
|
|||||||
Reference in New Issue
Block a user