mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 02:10:35 +08:00
Optimized Array<>::clear()
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user