Codechange: replace x.size() == 0 with x.empty()

This commit is contained in:
Rubidium
2023-10-20 20:09:58 +02:00
committed by rubidium42
parent f06b3e9846
commit c9276c2959
42 changed files with 58 additions and 58 deletions

View File

@@ -53,7 +53,7 @@ class Kdtree {
/** Create one new node in the tree, return its index in the pool */
size_t AddNode(const T &element)
{
if (this->free_list.size() == 0) {
if (this->free_list.empty()) {
this->nodes.emplace_back(element);
return this->nodes.size() - 1;
} else {

View File

@@ -20,7 +20,7 @@
{
PoolVector *pools = PoolBase::GetPools();
pools->erase(std::find(pools->begin(), pools->end(), this));
if (pools->size() == 0) delete pools;
if (pools->empty()) delete pools;
}
/**

View File

@@ -84,7 +84,7 @@ public:
constexpr size_t size() const noexcept { return static_cast<size_t>( last - first ); }
constexpr std::ptrdiff_t ssize() const noexcept { return static_cast<std::ptrdiff_t>( last - first ); }
constexpr bool empty() const noexcept { return size() == 0; }
constexpr bool empty() const noexcept { return this->size() == 0; }
constexpr iterator begin() const noexcept { return iterator(first); }
constexpr iterator end() const noexcept { return iterator(last); }