mirror of
https://github.com/esphome/esphome.git
synced 2025-10-16 07:27:50 +02:00
merge
This commit is contained in:
parent
fa830cfd39
commit
e17cdffc78
@ -217,6 +217,8 @@ template<typename T> class FixedVector {
|
||||
reset_();
|
||||
if (n > 0) {
|
||||
// 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)));
|
||||
capacity_ = n;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user