mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +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:
@@ -193,7 +193,7 @@ public:
|
||||
if (!c) continue;
|
||||
addPersonTarget(pre, c->name, /*require_position=*/false);
|
||||
}
|
||||
for (int idx = 0; ; idx++) {
|
||||
for (int idx = 0; _target_n < TARGET_MAX; idx++) {
|
||||
ContactInfo c;
|
||||
if (!the_mesh.getContactByIdx(idx, c)) break;
|
||||
addPersonTarget(c.id.pub_key, c.name, /*require_position=*/true);
|
||||
|
||||
Reference in New Issue
Block a user