1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00

[core] Rename FixedVector::shrink_to_fit() to release() for clarity (#13130)

This commit is contained in:
J. Nick Koston
2026-01-10 14:43:31 -10:00
committed by GitHub
parent 6c981d8b71
commit de82f96ccb
2 changed files with 4 additions and 4 deletions

View File

@@ -2014,8 +2014,8 @@ void WiFiComponent::release_scan_results_() {
// std::vector - use swap trick since shrink_to_fit is non-binding
decltype(this->scan_result_)().swap(this->scan_result_);
#else
// FixedVector::shrink_to_fit() actually frees all memory
this->scan_result_.shrink_to_fit();
// FixedVector::release() frees all memory
this->scan_result_.release();
#endif
}
}

View File

@@ -293,8 +293,8 @@ template<typename T> class FixedVector {
size_ = 0;
}
// Shrink capacity to fit current size (frees all memory)
void shrink_to_fit() {
// Release all memory (destroys elements and frees memory)
void release() {
cleanup_();
reset_();
}