mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Optimized Array<>::clear()
This commit is contained in:
parent
af00efade2
commit
e4530daa2d
@ -95,6 +95,8 @@ public:
|
||||
}
|
||||
|
||||
SizeType capacity() const { return MaxSize; }
|
||||
|
||||
void clear() { size_ = 0; }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -240,7 +242,7 @@ class Array : public ArrayImpl<T, ArrayMode, MaxSize_>
|
||||
int decodeImpl(ScalarCodec& codec, const TailArrayOptimizationMode tao_mode, TrueType) /// Dynamic
|
||||
{
|
||||
StaticAssert<IsDynamic>::check();
|
||||
clear();
|
||||
Base::clear();
|
||||
if (isOptimizedTailArray(tao_mode))
|
||||
{
|
||||
while (true)
|
||||
@ -320,8 +322,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void clear() { resize(0); }
|
||||
|
||||
template <typename R>
|
||||
bool operator==(const R& rhs) const
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user