mirror of
https://github.com/esphome/esphome.git
synced 2025-10-18 17:53:47 +01:00
merge
This commit is contained in:
@@ -217,6 +217,8 @@ template<typename T> class FixedVector {
|
|||||||
reset_();
|
reset_();
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
// Allocate raw memory without calling constructors
|
// Allocate raw memory without calling constructors
|
||||||
|
// sizeof(T) is correct here - when T is a pointer type, we want the pointer size
|
||||||
|
// NOLINTNEXTLINE(bugprone-sizeof-expression)
|
||||||
data_ = static_cast<T *>(::operator new(n * sizeof(T)));
|
data_ = static_cast<T *>(::operator new(n * sizeof(T)));
|
||||||
capacity_ = n;
|
capacity_ = n;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user