BLI: rename Vector.empty to Vector.is_empty
This commit is contained in:
parent
c05ef1459c
commit
a72eed7dd5
|
@ -427,7 +427,7 @@ class Vector {
|
|||
/**
|
||||
* Returns true when the vector contains no elements, otherwise false.
|
||||
*/
|
||||
bool empty() const
|
||||
bool is_empty() const
|
||||
{
|
||||
return m_begin == m_end;
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ class Vector {
|
|||
*/
|
||||
void remove_last()
|
||||
{
|
||||
BLI_assert(!this->empty());
|
||||
BLI_assert(!this->is_empty());
|
||||
m_end--;
|
||||
destruct(m_end);
|
||||
UPDATE_VECTOR_SIZE(this);
|
||||
|
@ -449,7 +449,7 @@ class Vector {
|
|||
*/
|
||||
T pop_last()
|
||||
{
|
||||
BLI_assert(!this->empty());
|
||||
BLI_assert(!this->is_empty());
|
||||
m_end--;
|
||||
T value = std::move(*m_end);
|
||||
destruct(m_end);
|
||||
|
|
|
@ -345,14 +345,14 @@ TEST(vector, RemoveLast)
|
|||
EXPECT_EQ(vec.size(), 0);
|
||||
}
|
||||
|
||||
TEST(vector, Empty)
|
||||
TEST(vector, IsEmpty)
|
||||
{
|
||||
IntVector vec;
|
||||
EXPECT_TRUE(vec.empty());
|
||||
EXPECT_TRUE(vec.is_empty());
|
||||
vec.append(1);
|
||||
EXPECT_FALSE(vec.empty());
|
||||
EXPECT_FALSE(vec.is_empty());
|
||||
vec.remove_last();
|
||||
EXPECT_TRUE(vec.empty());
|
||||
EXPECT_TRUE(vec.is_empty());
|
||||
}
|
||||
|
||||
TEST(vector, RemoveReorder)
|
||||
|
@ -368,7 +368,7 @@ TEST(vector, RemoveReorder)
|
|||
vec.remove_and_reorder(0);
|
||||
EXPECT_EQ(vec[0], 7);
|
||||
vec.remove_and_reorder(0);
|
||||
EXPECT_TRUE(vec.empty());
|
||||
EXPECT_TRUE(vec.is_empty());
|
||||
}
|
||||
|
||||
TEST(vector, RemoveFirstOccurrenceAndReorder)
|
||||
|
|
Loading…
Reference in New Issue