mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 07:45:56 +00:00
[wifi] Use FixedVector for scan results to reduce flash usage (#11216)
This commit is contained in:
@@ -549,7 +549,7 @@ void WiFiComponent::start_scanning() {
|
||||
// Using insertion sort instead of std::stable_sort saves flash memory
|
||||
// by avoiding template instantiations (std::rotate, std::stable_sort, lambdas)
|
||||
// IMPORTANT: This sort is stable (preserves relative order of equal elements)
|
||||
static void insertion_sort_scan_results(std::vector<WiFiScanResult> &results) {
|
||||
template<typename VectorType> static void insertion_sort_scan_results(VectorType &results) {
|
||||
const size_t size = results.size();
|
||||
for (size_t i = 1; i < size; i++) {
|
||||
// Make a copy to avoid issues with move semantics during comparison
|
||||
|
||||
Reference in New Issue
Block a user