diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-07-03 16:17:03 -0600 |
---|---|---|
committer | Aaron Record <aaronjrecord@gmail.com> | 2021-11-23 18:58:57 -0700 |
commit | e078f970db0e72bcc665d714416e6fc74e8434a6 (patch) | |
tree | 21fb39b40de2674a99018d88e142e6f0196c68b0 /core/templates | |
parent | 5efe80f3085c8c6451363fe4c743bf3d7fc20b6c (diff) |
Rename `remove()` to `remove_at()` when removing by index
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/bin_sorted_array.h | 2 | ||||
-rw-r--r-- | core/templates/cowdata.h | 2 | ||||
-rw-r--r-- | core/templates/local_vector.h | 6 | ||||
-rw-r--r-- | core/templates/vector.h | 4 | ||||
-rw-r--r-- | core/templates/vmap.h | 2 | ||||
-rw-r--r-- | core/templates/vset.h | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/core/templates/bin_sorted_array.h b/core/templates/bin_sorted_array.h index be9d0b5475..8db3e7aeb8 100644 --- a/core/templates/bin_sorted_array.h +++ b/core/templates/bin_sorted_array.h @@ -112,7 +112,7 @@ public: return current_idx; } - void remove(uint64_t p_idx) { + void remove_at(uint64_t p_idx) { ERR_FAIL_COND(p_idx >= array.size()); uint64_t new_idx = move(p_idx, 0); uint64_t swap_idx = array.size() - 1; diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index 9b8c0eb528..e79ca037db 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -167,7 +167,7 @@ public: Error resize(int p_size); - _FORCE_INLINE_ void remove(int p_index) { + _FORCE_INLINE_ void remove_at(int p_index) { ERR_FAIL_INDEX(p_index, size()); T *p = ptrw(); int len = size(); diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 5704b8f230..3854e1e94c 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -70,7 +70,7 @@ public: } } - void remove(U p_index) { + void remove_at(U p_index) { ERR_FAIL_UNSIGNED_INDEX(p_index, count); count--; for (U i = p_index; i < count; i++) { @@ -83,7 +83,7 @@ public: /// Removes the item copying the last value into the position of the one to /// remove. It's generally faster than `remove`. - void remove_unordered(U p_index) { + void remove_at_unordered(U p_index) { ERR_FAIL_INDEX(p_index, count); count--; if (count > p_index) { @@ -97,7 +97,7 @@ public: void erase(const T &p_val) { int64_t idx = find(p_val); if (idx >= 0) { - remove(idx); + remove_at(idx); } } diff --git a/core/templates/vector.h b/core/templates/vector.h index 98982c80d3..a955d49101 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -68,11 +68,11 @@ public: _FORCE_INLINE_ bool append(const T &p_elem) { return push_back(p_elem); } //alias void fill(T p_elem); - void remove(int p_index) { _cowdata.remove(p_index); } + void remove_at(int p_index) { _cowdata.remove_at(p_index); } void erase(const T &p_val) { int idx = find(p_val); if (idx >= 0) { - remove(idx); + remove_at(idx); } } void reverse(); diff --git a/core/templates/vmap.h b/core/templates/vmap.h index 520e0b3720..2aa22f97cf 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -134,7 +134,7 @@ public: if (pos < 0) { return; } - _cowdata.remove(pos); + _cowdata.remove_at(pos); } int find(const T &p_val) const { diff --git a/core/templates/vset.h b/core/templates/vset.h index 6665651d42..94e7a17061 100644 --- a/core/templates/vset.h +++ b/core/templates/vset.h @@ -119,7 +119,7 @@ public: if (pos < 0) { return; } - _data.remove(pos); + _data.remove_at(pos); } int find(const T &p_val) const { |