Skip to content

Commit

Permalink
Comment update
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed May 31, 2024
1 parent 3c5c31b commit 3b1d668
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ CHIP_ERROR ThreadScanResponseToTLV::LoadResponses(Platform::ScopedMemoryBuffer<T
}
scanResponseArray[scanResponseArrayLength - 1] = scanResponse;

// TODO: this is a sort (insertion sort even, so O(n^2)) in a O(n) loop,
/// maybe we should find something better than a O(n^3) to preserve the highest rssi only
// TODO: this is a sort (insertion sort even, so O(n^2)) in a O(n) loop.
/// There should be some better alternatives to not have some O(n^3) processing complexity.
Sorting::InsertionSort(scanResponseArray.Get(), scanResponseArrayLength,
[](const ThreadScanResponse & a, const ThreadScanResponse & b) -> bool { return a.rssi > b.rssi; });
}
Expand Down

0 comments on commit 3b1d668

Please sign in to comment.