summaryrefslogtreecommitdiff
path: root/core/pool_vector.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-11-01 14:04:16 +0100
committerGitHub <noreply@github.com>2019-11-01 14:04:16 +0100
commit962fc725c03685ea87c389233572e885117d1914 (patch)
treea757f3f35f49abe701f1345f35ec4bde2a1e0c74 /core/pool_vector.h
parent81b53f5a5c4e001bc203c1cfc58ef2346ebf1db8 (diff)
parent475115c0c3615c215f87b88a74ad40f1ccec7416 (diff)
Merge pull request #33210 from nekomatata/pool-array-empty
Added empty() function to pool array types
Diffstat (limited to 'core/pool_vector.h')
-rw-r--r--core/pool_vector.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/pool_vector.h b/core/pool_vector.h
index fbd4d630be..a698e72e18 100644
--- a/core/pool_vector.h
+++ b/core/pool_vector.h
@@ -385,6 +385,7 @@ public:
}
inline int size() const;
+ inline bool empty() const;
T get(int p_index) const;
void set(int p_index, const T &p_val);
void push_back(const T &p_val);
@@ -475,6 +476,12 @@ int PoolVector<T>::size() const {
}
template <class T>
+bool PoolVector<T>::empty() const {
+
+ return alloc ? alloc->size == 0 : true;
+}
+
+template <class T>
T PoolVector<T>::get(int p_index) const {
return operator[](p_index);