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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user