Rename `remove()` to `remove_at()` when removing by index

This commit is contained in:
Lightning_A 2021-07-03 16:17:03 -06:00 committed by Aaron Record
parent 5efe80f308
commit e078f970db
134 changed files with 323 additions and 323 deletions

View File

@ -1351,7 +1351,7 @@ void Input::add_joy_mapping(String p_mapping, bool p_update_existing) {
void Input::remove_joy_mapping(String p_guid) { void Input::remove_joy_mapping(String p_guid) {
for (int i = map_db.size() - 1; i >= 0; i--) { for (int i = map_db.size() - 1; i >= 0; i--) {
if (p_guid == map_db[i].uid) { if (p_guid == map_db[i].uid) {
map_db.remove(i); map_db.remove_at(i);
} }
} }
for (KeyValue<int, Joypad> &E : joy_names) { for (KeyValue<int, Joypad> &E : joy_names) {

View File

@ -344,7 +344,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
} }
sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list
open_list.remove(open_list.size() - 1); open_list.remove_at(open_list.size() - 1);
p->closed_pass = pass; // Mark the point as closed p->closed_pass = pass; // Mark the point as closed
for (OAHashMap<int, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { for (OAHashMap<int, Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
@ -812,7 +812,7 @@ bool AStar2D::_solve(AStar::Point *begin_point, AStar::Point *end_point) {
} }
sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list
open_list.remove(open_list.size() - 1); open_list.remove_at(open_list.size() - 1);
p->closed_pass = astar.pass; // Mark the point as closed p->closed_pass = astar.pass; // Mark the point as closed
for (OAHashMap<int, AStar::Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) { for (OAHashMap<int, AStar::Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {

View File

@ -654,7 +654,7 @@ private:
// remove from changed items (not very efficient yet) // remove from changed items (not very efficient yet)
for (int n = 0; n < (int)changed_items.size(); n++) { for (int n = 0; n < (int)changed_items.size(); n++) {
if (changed_items[n] == p_handle) { if (changed_items[n] == p_handle) {
changed_items.remove_unordered(n); changed_items.remove_at_unordered(n);
// because we are using an unordered remove, // because we are using an unordered remove,
// the last changed item will now be at spot 'n', // the last changed item will now be at spot 'n',

View File

@ -51,7 +51,7 @@ struct ItemPairs {
for (int n = 0; n < num_pairs; n++) { for (int n = 0; n < num_pairs; n++) {
if (extended_pairs[n].handle == h) { if (extended_pairs[n].handle == h) {
userdata = extended_pairs[n].userdata; userdata = extended_pairs[n].userdata;
extended_pairs.remove_unordered(n); extended_pairs.remove_at_unordered(n);
num_pairs--; num_pairs--;
break; break;
} }

View File

@ -1688,7 +1688,7 @@ real_t ConvexHullInternal::shrink(real_t p_amount, real_t p_clamp_amount) {
while (stack.size() > 0) { while (stack.size() > 0) {
Vertex *v = stack[stack.size() - 1]; Vertex *v = stack[stack.size() - 1];
stack.remove(stack.size() - 1); stack.remove_at(stack.size() - 1);
Edge *e = v->edges; Edge *e = v->edges;
if (e) { if (e) {
do { do {

View File

@ -123,7 +123,7 @@ public:
for (int j = 0; j < triangles.size(); j++) { for (int j = 0; j < triangles.size(); j++) {
if (triangles[j].bad) { if (triangles[j].bad) {
triangles.remove(j); triangles.remove_at(j);
j--; j--;
} }
} }
@ -154,7 +154,7 @@ public:
} }
} }
if (invalid) { if (invalid) {
triangles.remove(i); triangles.remove_at(i);
i--; i--;
} }
} }

View File

@ -1087,7 +1087,7 @@ Expression::ENode *Expression::_parse_expression() {
op->nodes[1] = nullptr; op->nodes[1] = nullptr;
expression.write[i].is_op = false; expression.write[i].is_op = false;
expression.write[i].node = op; expression.write[i].node = op;
expression.remove(i + 1); expression.remove_at(i + 1);
} }
} else { } else {
@ -1119,8 +1119,8 @@ Expression::ENode *Expression::_parse_expression() {
//replace all 3 nodes by this operator and make it an expression //replace all 3 nodes by this operator and make it an expression
expression.write[next_op - 1].node = op; expression.write[next_op - 1].node = op;
expression.remove(next_op); expression.remove_at(next_op);
expression.remove(next_op); expression.remove_at(next_op);
} }
} }

View File

@ -282,7 +282,7 @@ void UndoRedo::_pop_history_tail() {
} }
} }
actions.remove(0); actions.remove_at(0);
if (current_action >= 0) { if (current_action >= 0) {
current_action--; current_action--;
} }

View File

@ -293,12 +293,12 @@ void NodePath::simplify() {
break; break;
} }
if (data->path[i].operator String() == ".") { if (data->path[i].operator String() == ".") {
data->path.remove(i); data->path.remove_at(i);
i--; i--;
} else if (i > 0 && data->path[i].operator String() == ".." && data->path[i - 1].operator String() != "." && data->path[i - 1].operator String() != "..") { } else if (i > 0 && data->path[i].operator String() == ".." && data->path[i - 1].operator String() != "." && data->path[i - 1].operator String() != "..") {
//remove both //remove both
data->path.remove(i - 1); data->path.remove_at(i - 1);
data->path.remove(i - 1); data->path.remove_at(i - 1);
i -= 2; i -= 2;
if (data->path.size() == 0) { if (data->path.size() == 0) {
data->path.push_back("."); data->path.push_back(".");

View File

@ -3670,15 +3670,15 @@ String String::simplify_path() const {
for (int i = 0; i < dirs.size(); i++) { for (int i = 0; i < dirs.size(); i++) {
String d = dirs[i]; String d = dirs[i];
if (d == ".") { if (d == ".") {
dirs.remove(i); dirs.remove_at(i);
i--; i--;
} else if (d == "..") { } else if (d == "..") {
if (i == 0) { if (i == 0) {
dirs.remove(i); dirs.remove_at(i);
i--; i--;
} else { } else {
dirs.remove(i); dirs.remove_at(i);
dirs.remove(i - 1); dirs.remove_at(i - 1);
i -= 2; i -= 2;
} }
} }

View File

@ -209,7 +209,7 @@ public:
_FORCE_INLINE_ char32_t *ptrw() { return _cowdata.ptrw(); } _FORCE_INLINE_ char32_t *ptrw() { return _cowdata.ptrw(); }
_FORCE_INLINE_ const char32_t *ptr() const { return _cowdata.ptr(); } _FORCE_INLINE_ const char32_t *ptr() const { return _cowdata.ptr(); }
void remove(int p_index) { _cowdata.remove(p_index); } void remove_at(int p_index) { _cowdata.remove_at(p_index); }
_FORCE_INLINE_ void clear() { resize(0); } _FORCE_INLINE_ void clear() { resize(0); }

View File

@ -112,7 +112,7 @@ public:
return current_idx; return current_idx;
} }
void remove(uint64_t p_idx) { void remove_at(uint64_t p_idx) {
ERR_FAIL_COND(p_idx >= array.size()); ERR_FAIL_COND(p_idx >= array.size());
uint64_t new_idx = move(p_idx, 0); uint64_t new_idx = move(p_idx, 0);
uint64_t swap_idx = array.size() - 1; uint64_t swap_idx = array.size() - 1;

View File

@ -167,7 +167,7 @@ public:
Error resize(int p_size); 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()); ERR_FAIL_INDEX(p_index, size());
T *p = ptrw(); T *p = ptrw();
int len = size(); int len = size();

View File

@ -70,7 +70,7 @@ public:
} }
} }
void remove(U p_index) { void remove_at(U p_index) {
ERR_FAIL_UNSIGNED_INDEX(p_index, count); ERR_FAIL_UNSIGNED_INDEX(p_index, count);
count--; count--;
for (U i = p_index; i < count; i++) { 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 /// Removes the item copying the last value into the position of the one to
/// remove. It's generally faster than `remove`. /// 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); ERR_FAIL_INDEX(p_index, count);
count--; count--;
if (count > p_index) { if (count > p_index) {
@ -97,7 +97,7 @@ public:
void erase(const T &p_val) { void erase(const T &p_val) {
int64_t idx = find(p_val); int64_t idx = find(p_val);
if (idx >= 0) { if (idx >= 0) {
remove(idx); remove_at(idx);
} }
} }

View File

@ -68,11 +68,11 @@ public:
_FORCE_INLINE_ bool append(const T &p_elem) { return push_back(p_elem); } //alias _FORCE_INLINE_ bool append(const T &p_elem) { return push_back(p_elem); } //alias
void fill(T p_elem); 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) { void erase(const T &p_val) {
int idx = find(p_val); int idx = find(p_val);
if (idx >= 0) { if (idx >= 0) {
remove(idx); remove_at(idx);
} }
} }
void reverse(); void reverse();

View File

@ -134,7 +134,7 @@ public:
if (pos < 0) { if (pos < 0) {
return; return;
} }
_cowdata.remove(pos); _cowdata.remove_at(pos);
} }
int find(const T &p_val) const { int find(const T &p_val) const {

View File

@ -119,7 +119,7 @@ public:
if (pos < 0) { if (pos < 0) {
return; return;
} }
_data.remove(pos); _data.remove_at(pos);
} }
int find(const T &p_val) const { int find(const T &p_val) const {

View File

@ -322,8 +322,8 @@ bool Array::has(const Variant &p_value) const {
return _p->array.find(p_value, 0) != -1; return _p->array.find(p_value, 0) != -1;
} }
void Array::remove(int p_pos) { void Array::remove_at(int p_pos) {
_p->array.remove(p_pos); _p->array.remove_at(p_pos);
} }
void Array::set(int p_idx, const Variant &p_value) { void Array::set(int p_idx, const Variant &p_value) {
@ -576,7 +576,7 @@ Variant Array::pop_back() {
Variant Array::pop_front() { Variant Array::pop_front() {
if (!_p->array.is_empty()) { if (!_p->array.is_empty()) {
const Variant ret = _p->array.get(0); const Variant ret = _p->array.get(0);
_p->array.remove(0); _p->array.remove_at(0);
return ret; return ret;
} }
return Variant(); return Variant();
@ -603,7 +603,7 @@ Variant Array::pop_at(int p_pos) {
_p->array.size())); _p->array.size()));
const Variant ret = _p->array.get(p_pos); const Variant ret = _p->array.get(p_pos);
_p->array.remove(p_pos); _p->array.remove_at(p_pos);
return ret; return ret;
} }

View File

@ -75,7 +75,7 @@ public:
Error resize(int p_new_size); Error resize(int p_new_size);
Error insert(int p_pos, const Variant &p_value); Error insert(int p_pos, const Variant &p_value);
void remove(int p_pos); void remove_at(int p_pos);
void fill(const Variant &p_value); void fill(const Variant &p_value);
Variant front() const; Variant front() const;

View File

@ -1808,7 +1808,7 @@ static void _register_variant_builtin_methods() {
bind_method(Array, append_array, sarray("array"), varray()); bind_method(Array, append_array, sarray("array"), varray());
bind_method(Array, resize, sarray("size"), varray()); bind_method(Array, resize, sarray("size"), varray());
bind_method(Array, insert, sarray("position", "value"), varray()); bind_method(Array, insert, sarray("position", "value"), varray());
bind_method(Array, remove, sarray("position"), varray()); bind_method(Array, remove_at, sarray("position"), varray());
bind_method(Array, fill, sarray("value"), varray()); bind_method(Array, fill, sarray("value"), varray());
bind_method(Array, erase, sarray("value"), varray()); bind_method(Array, erase, sarray("value"), varray());
bind_method(Array, front, sarray(), varray()); bind_method(Array, front, sarray(), varray());
@ -1842,7 +1842,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedByteArray, push_back, sarray("value"), varray()); bind_method(PackedByteArray, push_back, sarray("value"), varray());
bind_method(PackedByteArray, append, sarray("value"), varray()); bind_method(PackedByteArray, append, sarray("value"), varray());
bind_method(PackedByteArray, append_array, sarray("array"), varray()); bind_method(PackedByteArray, append_array, sarray("array"), varray());
bind_method(PackedByteArray, remove, sarray("index"), varray()); bind_method(PackedByteArray, remove_at, sarray("index"), varray());
bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray());
bind_method(PackedByteArray, fill, sarray("value"), varray()); bind_method(PackedByteArray, fill, sarray("value"), varray());
bind_method(PackedByteArray, resize, sarray("new_size"), varray()); bind_method(PackedByteArray, resize, sarray("new_size"), varray());
@ -1903,7 +1903,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedInt32Array, push_back, sarray("value"), varray()); bind_method(PackedInt32Array, push_back, sarray("value"), varray());
bind_method(PackedInt32Array, append, sarray("value"), varray()); bind_method(PackedInt32Array, append, sarray("value"), varray());
bind_method(PackedInt32Array, append_array, sarray("array"), varray()); bind_method(PackedInt32Array, append_array, sarray("array"), varray());
bind_method(PackedInt32Array, remove, sarray("index"), varray()); bind_method(PackedInt32Array, remove_at, sarray("index"), varray());
bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedInt32Array, fill, sarray("value"), varray()); bind_method(PackedInt32Array, fill, sarray("value"), varray());
bind_method(PackedInt32Array, resize, sarray("new_size"), varray()); bind_method(PackedInt32Array, resize, sarray("new_size"), varray());
@ -1923,7 +1923,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedInt64Array, push_back, sarray("value"), varray()); bind_method(PackedInt64Array, push_back, sarray("value"), varray());
bind_method(PackedInt64Array, append, sarray("value"), varray()); bind_method(PackedInt64Array, append, sarray("value"), varray());
bind_method(PackedInt64Array, append_array, sarray("array"), varray()); bind_method(PackedInt64Array, append_array, sarray("array"), varray());
bind_method(PackedInt64Array, remove, sarray("index"), varray()); bind_method(PackedInt64Array, remove_at, sarray("index"), varray());
bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedInt64Array, fill, sarray("value"), varray()); bind_method(PackedInt64Array, fill, sarray("value"), varray());
bind_method(PackedInt64Array, resize, sarray("new_size"), varray()); bind_method(PackedInt64Array, resize, sarray("new_size"), varray());
@ -1943,7 +1943,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedFloat32Array, push_back, sarray("value"), varray()); bind_method(PackedFloat32Array, push_back, sarray("value"), varray());
bind_method(PackedFloat32Array, append, sarray("value"), varray()); bind_method(PackedFloat32Array, append, sarray("value"), varray());
bind_method(PackedFloat32Array, append_array, sarray("array"), varray()); bind_method(PackedFloat32Array, append_array, sarray("array"), varray());
bind_method(PackedFloat32Array, remove, sarray("index"), varray()); bind_method(PackedFloat32Array, remove_at, sarray("index"), varray());
bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedFloat32Array, fill, sarray("value"), varray()); bind_method(PackedFloat32Array, fill, sarray("value"), varray());
bind_method(PackedFloat32Array, resize, sarray("new_size"), varray()); bind_method(PackedFloat32Array, resize, sarray("new_size"), varray());
@ -1963,7 +1963,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedFloat64Array, push_back, sarray("value"), varray()); bind_method(PackedFloat64Array, push_back, sarray("value"), varray());
bind_method(PackedFloat64Array, append, sarray("value"), varray()); bind_method(PackedFloat64Array, append, sarray("value"), varray());
bind_method(PackedFloat64Array, append_array, sarray("array"), varray()); bind_method(PackedFloat64Array, append_array, sarray("array"), varray());
bind_method(PackedFloat64Array, remove, sarray("index"), varray()); bind_method(PackedFloat64Array, remove_at, sarray("index"), varray());
bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedFloat64Array, fill, sarray("value"), varray()); bind_method(PackedFloat64Array, fill, sarray("value"), varray());
bind_method(PackedFloat64Array, resize, sarray("new_size"), varray()); bind_method(PackedFloat64Array, resize, sarray("new_size"), varray());
@ -1983,7 +1983,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedStringArray, push_back, sarray("value"), varray()); bind_method(PackedStringArray, push_back, sarray("value"), varray());
bind_method(PackedStringArray, append, sarray("value"), varray()); bind_method(PackedStringArray, append, sarray("value"), varray());
bind_method(PackedStringArray, append_array, sarray("array"), varray()); bind_method(PackedStringArray, append_array, sarray("array"), varray());
bind_method(PackedStringArray, remove, sarray("index"), varray()); bind_method(PackedStringArray, remove_at, sarray("index"), varray());
bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray());
bind_method(PackedStringArray, fill, sarray("value"), varray()); bind_method(PackedStringArray, fill, sarray("value"), varray());
bind_method(PackedStringArray, resize, sarray("new_size"), varray()); bind_method(PackedStringArray, resize, sarray("new_size"), varray());
@ -2003,7 +2003,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedVector2Array, push_back, sarray("value"), varray()); bind_method(PackedVector2Array, push_back, sarray("value"), varray());
bind_method(PackedVector2Array, append, sarray("value"), varray()); bind_method(PackedVector2Array, append, sarray("value"), varray());
bind_method(PackedVector2Array, append_array, sarray("array"), varray()); bind_method(PackedVector2Array, append_array, sarray("array"), varray());
bind_method(PackedVector2Array, remove, sarray("index"), varray()); bind_method(PackedVector2Array, remove_at, sarray("index"), varray());
bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedVector2Array, fill, sarray("value"), varray()); bind_method(PackedVector2Array, fill, sarray("value"), varray());
bind_method(PackedVector2Array, resize, sarray("new_size"), varray()); bind_method(PackedVector2Array, resize, sarray("new_size"), varray());
@ -2023,7 +2023,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedVector3Array, push_back, sarray("value"), varray()); bind_method(PackedVector3Array, push_back, sarray("value"), varray());
bind_method(PackedVector3Array, append, sarray("value"), varray()); bind_method(PackedVector3Array, append, sarray("value"), varray());
bind_method(PackedVector3Array, append_array, sarray("array"), varray()); bind_method(PackedVector3Array, append_array, sarray("array"), varray());
bind_method(PackedVector3Array, remove, sarray("index"), varray()); bind_method(PackedVector3Array, remove_at, sarray("index"), varray());
bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray()); bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray());
bind_method(PackedVector3Array, fill, sarray("value"), varray()); bind_method(PackedVector3Array, fill, sarray("value"), varray());
bind_method(PackedVector3Array, resize, sarray("new_size"), varray()); bind_method(PackedVector3Array, resize, sarray("new_size"), varray());
@ -2043,7 +2043,7 @@ static void _register_variant_builtin_methods() {
bind_method(PackedColorArray, push_back, sarray("value"), varray()); bind_method(PackedColorArray, push_back, sarray("value"), varray());
bind_method(PackedColorArray, append, sarray("value"), varray()); bind_method(PackedColorArray, append, sarray("value"), varray());
bind_method(PackedColorArray, append_array, sarray("array"), varray()); bind_method(PackedColorArray, append_array, sarray("array"), varray());
bind_method(PackedColorArray, remove, sarray("index"), varray()); bind_method(PackedColorArray, remove_at, sarray("index"), varray());
bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray()); bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray());
bind_method(PackedColorArray, fill, sarray("value"), varray()); bind_method(PackedColorArray, fill, sarray("value"), varray());
bind_method(PackedColorArray, resize, sarray("new_size"), varray()); bind_method(PackedColorArray, resize, sarray("new_size"), varray());

View File

@ -704,7 +704,7 @@ struct VariantIndexedSetGet_String {
String *b = VariantGetInternalPtr<String>::get_ptr(base); String *b = VariantGetInternalPtr<String>::get_ptr(base);
const String *v = VariantInternal::get_string(value); const String *v = VariantInternal::get_string(value);
if (v->length() == 0) { if (v->length() == 0) {
b->remove(index); b->remove_at(index);
} else { } else {
b->set(index, v->get(0)); b->set(index, v->get(0));
} }
@ -723,7 +723,7 @@ struct VariantIndexedSetGet_String {
String *b = VariantGetInternalPtr<String>::get_ptr(base); String *b = VariantGetInternalPtr<String>::get_ptr(base);
const String *v = VariantInternal::get_string(value); const String *v = VariantInternal::get_string(value);
if (v->length() == 0) { if (v->length() == 0) {
b->remove(index); b->remove_at(index);
} else { } else {
b->set(index, v->get(0)); b->set(index, v->get(0));
} }
@ -738,7 +738,7 @@ struct VariantIndexedSetGet_String {
OOB_TEST(index, v.length()); OOB_TEST(index, v.length());
const String &m = *reinterpret_cast<const String *>(member); const String &m = *reinterpret_cast<const String *>(member);
if (unlikely(m.length() == 0)) { if (unlikely(m.length() == 0)) {
v.remove(index); v.remove_at(index);
} else { } else {
v.set(index, m.unicode_at(0)); v.set(index, m.unicode_at(0));
} }

View File

@ -194,7 +194,7 @@
<return type="void" /> <return type="void" />
<argument index="0" name="value" type="Variant" /> <argument index="0" name="value" type="Variant" />
<description> <description>
Removes the first occurrence of a value from the array. To remove an element by index, use [method remove] instead. Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead.
[b]Note:[/b] This method acts in-place and doesn't return a value. [b]Note:[/b] This method acts in-place and doesn't return a value.
[b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
</description> </description>
@ -400,7 +400,7 @@
[/codeblock] [/codeblock]
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="position" type="int" /> <argument index="0" name="position" type="int" />
<description> <description>

View File

@ -332,7 +332,7 @@
Appends an element at the end of the array. Appends an element at the end of the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -95,7 +95,7 @@
Appends a value to the array. Appends a value to the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Appends an element at the end of the array. Appends an element at the end of the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Appends an element at the end of the array. Appends an element at the end of the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Appends a value to the array. Appends a value to the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Appends a value to the array. Appends a value to the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Appends a string element at end of the array. Appends a string element at end of the array.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -96,7 +96,7 @@
Inserts a [Vector2] at the end. Inserts a [Vector2] at the end.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -95,7 +95,7 @@
Inserts a [Vector3] at the end. Inserts a [Vector3] at the end.
</description> </description>
</method> </method>
<method name="remove"> <method name="remove_at">
<return type="void" /> <return type="void" />
<argument index="0" name="index" type="int" /> <argument index="0" name="index" type="int" />
<description> <description>

View File

@ -847,7 +847,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i
int event_index = item->get_meta("__index"); int event_index = item->get_meta("__index");
Array events = action["events"]; Array events = action["events"];
events.remove(event_index); events.remove_at(event_index);
action["events"] = events; action["events"] = events;
emit_signal(SNAME("action_edited"), action_name, action); emit_signal(SNAME("action_edited"), action_name, action);

View File

@ -240,7 +240,7 @@ void ConnectDialog::_remove_bind() {
int idx = st.get_slice("/", 1).to_int() - 1; int idx = st.get_slice("/", 1).to_int() - 1;
ERR_FAIL_INDEX(idx, cdbinds->params.size()); ERR_FAIL_INDEX(idx, cdbinds->params.size());
cdbinds->params.remove(idx); cdbinds->params.remove_at(idx);
cdbinds->notify_changed(); cdbinds->notify_changed();
} }
@ -723,7 +723,7 @@ void ConnectionsDock::_open_connection_dialog(TreeItem &item) {
c = '_'; c = '_';
} else { } else {
// Remove any other characters. // Remove any other characters.
midname.remove(i); midname.remove_at(i);
i--; i--;
continue; continue;
} }

View File

@ -576,7 +576,7 @@ void CreateDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Co
drop_idx--; drop_idx--;
} }
favorite_list.remove(from_idx); favorite_list.remove_at(from_idx);
if (ds < 0) { if (ds < 0) {
favorite_list.insert(drop_idx, type); favorite_list.insert(drop_idx, type);

View File

@ -70,7 +70,7 @@ void EditorHistory::cleanup_history() {
} }
if (fail) { if (fail) {
history.remove(i); history.remove_at(i);
i--; i--;
} }
} }
@ -510,7 +510,7 @@ void EditorData::remove_custom_type(const String &p_type) {
for (Map<String, Vector<CustomType>>::Element *E = custom_types.front(); E; E = E->next()) { for (Map<String, Vector<CustomType>>::Element *E = custom_types.front(); E; E = E->next()) {
for (int i = 0; i < E->get().size(); i++) { for (int i = 0; i < E->get().size(); i++) {
if (E->get()[i].name == p_type) { if (E->get()[i].name == p_type) {
E->get().remove(i); E->get().remove_at(i);
if (E->get().is_empty()) { if (E->get().is_empty()) {
custom_types.erase(E->key()); custom_types.erase(E->key());
} }
@ -570,7 +570,7 @@ void EditorData::remove_scene(int p_idx) {
ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(edited_scene[p_idx].path); ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(edited_scene[p_idx].path);
} }
edited_scene.remove(p_idx); edited_scene.remove_at(p_idx);
} }
bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths) { bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths) {
@ -751,7 +751,7 @@ void EditorData::move_edited_scene_to_index(int p_idx) {
ERR_FAIL_INDEX(p_idx, edited_scene.size()); ERR_FAIL_INDEX(p_idx, edited_scene.size());
EditedScene es = edited_scene[current_edited_scene]; EditedScene es = edited_scene[current_edited_scene];
edited_scene.remove(current_edited_scene); edited_scene.remove_at(current_edited_scene);
edited_scene.insert(p_idx, es); edited_scene.insert(p_idx, es);
current_edited_scene = p_idx; current_edited_scene = p_idx;
} }

View File

@ -1534,7 +1534,7 @@ Ref<EditorExportPreset> EditorExport::get_export_preset(int p_idx) {
} }
void EditorExport::remove_export_preset(int p_idx) { void EditorExport::remove_export_preset(int p_idx) {
export_presets.remove(p_idx); export_presets.remove_at(p_idx);
save_presets(); save_presets();
} }

View File

@ -302,7 +302,7 @@ void EditorFileDialog::_post_popup() {
bool exists = dir_access->dir_exists(recentd[i]); bool exists = dir_access->dir_exists(recentd[i]);
if (!exists) { if (!exists) {
// Remove invalid directory from the list of Recent directories. // Remove invalid directory from the list of Recent directories.
recentd.remove(i--); recentd.remove_at(i--);
} else { } else {
recent->add_item(name, folder); recent->add_item(name, folder);
recent->set_item_metadata(recent->get_item_count() - 1, recentd[i]); recent->set_item_metadata(recent->get_item_count() - 1, recentd[i]);
@ -1445,7 +1445,7 @@ void EditorFileDialog::_save_to_recent() {
for (int i = 0; i < recent.size(); i++) { for (int i = 0; i < recent.size(); i++) {
bool cres = recent[i].begins_with("res://"); bool cres = recent[i].begins_with("res://");
if (recent[i] == dir || (res == cres && count > max)) { if (recent[i] == dir || (res == cres && count > max)) {
recent.remove(i); recent.remove_at(i);
i--; i--;
} else { } else {
count++; count++;

View File

@ -577,7 +577,7 @@ bool EditorFileSystem::_update_scan_actions() {
ERR_CONTINUE(idx == -1); ERR_CONTINUE(idx == -1);
_delete_internal_files(ia.dir->files[idx]->file); _delete_internal_files(ia.dir->files[idx]->file);
memdelete(ia.dir->files[idx]); memdelete(ia.dir->files[idx]);
ia.dir->files.remove(idx); ia.dir->files.remove_at(idx);
fs_changed = true; fs_changed = true;
@ -1536,7 +1536,7 @@ void EditorFileSystem::update_file(const String &p_file) {
} }
} }
memdelete(fs->files[cpos]); memdelete(fs->files[cpos]);
fs->files.remove(cpos); fs->files.remove_at(cpos);
} }
call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later call_deferred(SNAME("emit_signal"), "filesystem_changed"); //update later

View File

@ -1608,11 +1608,11 @@ void EditorInspectorArray::_move_element(int p_element_index, int p_to_pos) {
properties_as_array.insert(p_to_pos < 0 ? properties_as_array.size() : p_to_pos, Dictionary()); properties_as_array.insert(p_to_pos < 0 ? properties_as_array.size() : p_to_pos, Dictionary());
} else if (p_to_pos < 0) { } else if (p_to_pos < 0) {
// Delete the element. // Delete the element.
properties_as_array.remove(p_element_index); properties_as_array.remove_at(p_element_index);
} else { } else {
// Move the element. // Move the element.
properties_as_array.insert(p_to_pos, properties_as_array[p_element_index].duplicate()); properties_as_array.insert(p_to_pos, properties_as_array[p_element_index].duplicate());
properties_as_array.remove(p_to_pos < p_element_index ? p_element_index + 1 : p_element_index); properties_as_array.remove_at(p_to_pos < p_element_index ? p_element_index + 1 : p_element_index);
} }
// Change the array size then set the properties. // Change the array size then set the properties.

View File

@ -831,7 +831,7 @@ void EditorNode::_remove_plugin_from_enabled(const String &p_name) {
PackedStringArray enabled_plugins = ps->get("editor_plugins/enabled"); PackedStringArray enabled_plugins = ps->get("editor_plugins/enabled");
for (int i = 0; i < enabled_plugins.size(); ++i) { for (int i = 0; i < enabled_plugins.size(); ++i) {
if (enabled_plugins.get(i) == p_name) { if (enabled_plugins.get(i) == p_name) {
enabled_plugins.remove(i); enabled_plugins.remove_at(i);
break; break;
} }
} }
@ -3199,7 +3199,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan
} }
memdelete(singleton->main_editor_buttons[i]); memdelete(singleton->main_editor_buttons[i]);
singleton->main_editor_buttons.remove(i); singleton->main_editor_buttons.remove_at(i);
break; break;
} }
@ -3758,7 +3758,7 @@ void EditorNode::_open_recent_scene(int p_idx) {
ERR_FAIL_INDEX(p_idx, rc.size()); ERR_FAIL_INDEX(p_idx, rc.size());
if (load_scene(rc[p_idx]) != OK) { if (load_scene(rc[p_idx]) != OK) {
rc.remove(p_idx); rc.remove_at(p_idx);
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", rc); EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", rc);
_update_recent_scenes(); _update_recent_scenes();
} }
@ -5177,7 +5177,7 @@ void EditorNode::remove_bottom_panel_item(Control *p_item) {
bottom_panel_vb->remove_child(bottom_panel_items[i].control); bottom_panel_vb->remove_child(bottom_panel_items[i].control);
bottom_panel_hb_editors->remove_child(bottom_panel_items[i].button); bottom_panel_hb_editors->remove_child(bottom_panel_items[i].button);
memdelete(bottom_panel_items[i].button); memdelete(bottom_panel_items[i].button);
bottom_panel_items.remove(i); bottom_panel_items.remove_at(i);
break; break;
} }
} }

View File

@ -413,7 +413,7 @@ void EditorPropertyArray::update_property() {
void EditorPropertyArray::_remove_pressed(int p_index) { void EditorPropertyArray::_remove_pressed(int p_index) {
Variant array = object->get_array(); Variant array = object->get_array();
array.call("remove", p_index); array.call("remove_at", p_index);
emit_changed(get_edited_property(), array, "", false); emit_changed(get_edited_property(), array, "", false);
update_property(); update_property();

View File

@ -201,7 +201,7 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L
Vector<String> exec_args = p_custom_args.substr(0, placeholder_pos).split(" ", false); Vector<String> exec_args = p_custom_args.substr(0, placeholder_pos).split(" ", false);
if (exec_args.size() >= 1) { if (exec_args.size() >= 1) {
exec = exec_args[0]; exec = exec_args[0];
exec_args.remove(0); exec_args.remove_at(0);
// Append the Godot executable name before we append executable arguments // Append the Godot executable name before we append executable arguments
// (since the order is reversed when using `push_front()`). // (since the order is reversed when using `push_front()`).

View File

@ -197,7 +197,7 @@ Vector<String> FileSystemDock::_compute_uncollapsed_paths() {
child = child->get_next(); child = child->get_next();
} }
} }
needs_check.remove(0); needs_check.remove_at(0);
} }
} }
} }
@ -1093,7 +1093,7 @@ void FileSystemDock::_push_to_history() {
history_pos++; history_pos++;
if (history.size() > history_max_size) { if (history.size() > history_max_size) {
history.remove(0); history.remove_at(0);
history_pos = history_max_size - 1; history_pos = history_max_size - 1;
} }
} }
@ -1670,7 +1670,7 @@ Vector<String> FileSystemDock::_remove_self_included_paths(Vector<String> select
String last_path = ""; String last_path = "";
for (int i = 0; i < selected_strings.size(); i++) { for (int i = 0; i < selected_strings.size(); i++) {
if (last_path != "" && selected_strings[i].begins_with(last_path)) { if (last_path != "" && selected_strings[i].begins_with(last_path)) {
selected_strings.remove(i); selected_strings.remove_at(i);
i--; i--;
} }
if (selected_strings[i].ends_with("/")) { if (selected_strings[i].ends_with("/")) {
@ -1704,7 +1704,7 @@ void FileSystemDock::_tree_rmb_option(int p_option) {
child = child->get_next(); child = child->get_next();
} }
needs_check.remove(0); needs_check.remove_at(0);
} }
} }
} break; } break;
@ -2229,7 +2229,7 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data,
drop_position -= offset; drop_position -= offset;
to_remove.sort(); to_remove.sort();
for (int i = 0; i < to_remove.size(); i++) { for (int i = 0; i < to_remove.size(); i++) {
dirs.remove(to_remove[i] - i); dirs.remove_at(to_remove[i] - i);
} }
// Re-add them at the right position. // Re-add them at the right position.

View File

@ -2024,7 +2024,7 @@ void Collada::_create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton
bool Collada::_remove_node(Node *p_parent, Node *p_node) { bool Collada::_remove_node(Node *p_parent, Node *p_node) {
for (int i = 0; i < p_parent->children.size(); i++) { for (int i = 0; i < p_parent->children.size(); i++) {
if (p_parent->children[i] == p_node) { if (p_parent->children[i] == p_node) {
p_parent->children.remove(i); p_parent->children.remove_at(i);
return true; return true;
} }
if (_remove_node(p_parent->children[i], p_node)) { if (_remove_node(p_parent->children[i], p_node)) {
@ -2038,7 +2038,7 @@ bool Collada::_remove_node(Node *p_parent, Node *p_node) {
void Collada::_remove_node(VisualScene *p_vscene, Node *p_node) { void Collada::_remove_node(VisualScene *p_vscene, Node *p_node) {
for (int i = 0; i < p_vscene->root_nodes.size(); i++) { for (int i = 0; i < p_vscene->root_nodes.size(); i++) {
if (p_vscene->root_nodes[i] == p_node) { if (p_vscene->root_nodes[i] == p_node) {
p_vscene->root_nodes.remove(i); p_vscene->root_nodes.remove_at(i);
return; return;
} }
if (_remove_node(p_vscene->root_nodes[i], p_node)) { if (_remove_node(p_vscene->root_nodes[i], p_node)) {
@ -2271,7 +2271,7 @@ bool Collada::_move_geometry_to_skeletons(VisualScene *p_vscene, Node *p_node, L
for (int i = 0; i < p_node->children.size(); i++) { for (int i = 0; i < p_node->children.size(); i++) {
if (_move_geometry_to_skeletons(p_vscene, p_node->children[i], p_mgeom)) { if (_move_geometry_to_skeletons(p_vscene, p_node->children[i], p_mgeom)) {
p_node->children.remove(i); p_node->children.remove_at(i);
i--; i--;
} }
} }
@ -2325,7 +2325,7 @@ void Collada::_optimize() {
for (int i = 0; i < vs.root_nodes.size(); i++) { for (int i = 0; i < vs.root_nodes.size(); i++) {
List<Node *> mgeom; List<Node *> mgeom;
if (_move_geometry_to_skeletons(&vs, vs.root_nodes[i], &mgeom)) { if (_move_geometry_to_skeletons(&vs, vs.root_nodes[i], &mgeom)) {
vs.root_nodes.remove(i); vs.root_nodes.remove_at(i);
i--; i--;
} }

View File

@ -98,7 +98,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p
ERR_FAIL_INDEX(idx, translations.size()); ERR_FAIL_INDEX(idx, translations.size());
translations.remove(idx); translations.remove_at(idx);
undo_redo->create_action(TTR("Remove Translation")); undo_redo->create_action(TTR("Remove Translation"));
undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", translations); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations", translations);
@ -276,7 +276,7 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co
ERR_FAIL_COND(!remaps.has(key)); ERR_FAIL_COND(!remaps.has(key));
PackedStringArray r = remaps[key]; PackedStringArray r = remaps[key];
ERR_FAIL_INDEX(idx, r.size()); ERR_FAIL_INDEX(idx, r.size());
r.remove(idx); r.remove_at(idx);
remaps[key] = r; remaps[key] = r;
undo_redo->create_action(TTR("Remove Resource Remap Option")); undo_redo->create_action(TTR("Remove Resource Remap Option"));
@ -321,7 +321,7 @@ void LocalizationEditor::_translation_filter_option_changed() {
} }
} else { } else {
if (l_idx != -1) { if (l_idx != -1) {
f_locales.remove(l_idx); f_locales.remove_at(l_idx);
} }
} }
@ -397,7 +397,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button)
ERR_FAIL_INDEX(idx, pot_translations.size()); ERR_FAIL_INDEX(idx, pot_translations.size());
pot_translations.remove(idx); pot_translations.remove_at(idx);
undo_redo->create_action(TTR("Remove file from POT generation")); undo_redo->create_action(TTR("Remove file from POT generation"));
undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", pot_translations); undo_redo->add_do_property(ProjectSettings::get_singleton(), "internationalization/locale/translations_pot_files", pot_translations);

View File

@ -446,7 +446,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
if (k->get_keycode() == Key::KEY_DELETE || k->get_keycode() == Key::BACKSPACE) { if (k->get_keycode() == Key::KEY_DELETE || k->get_keycode() == Key::BACKSPACE) {
if (wip_active && selected_point.polygon == -1) { if (wip_active && selected_point.polygon == -1) {
if (wip.size() > selected_point.vertex) { if (wip.size() > selected_point.vertex) {
wip.remove(selected_point.vertex); wip.remove_at(selected_point.vertex);
_wip_changed(); _wip_changed();
selected_point = wip.size() - 1; selected_point = wip.size() - 1;
canvas_item_editor->update_viewport(); canvas_item_editor->update_viewport();
@ -599,7 +599,7 @@ void AbstractPolygon2DEditor::remove_point(const Vertex &p_vertex) {
Vector<Vector2> vertices = _get_polygon(p_vertex.polygon); Vector<Vector2> vertices = _get_polygon(p_vertex.polygon);
if (vertices.size() > (_is_line() ? 2 : 3)) { if (vertices.size() > (_is_line() ? 2 : 3)) {
vertices.remove(p_vertex.vertex); vertices.remove_at(p_vertex.vertex);
undo_redo->create_action(TTR("Edit Polygon (Remove Point)")); undo_redo->create_action(TTR("Edit Polygon (Remove Point)"));
_action_set_polygon(p_vertex.polygon, vertices); _action_set_polygon(p_vertex.polygon, vertices);

View File

@ -58,7 +58,7 @@ void AnimationNodeBlendTreeEditor::add_custom_type(const String &p_name, const R
void AnimationNodeBlendTreeEditor::remove_custom_type(const Ref<Script> &p_script) { void AnimationNodeBlendTreeEditor::remove_custom_type(const Ref<Script> &p_script) {
for (int i = 0; i < add_options.size(); i++) { for (int i = 0; i < add_options.size(); i++) {
if (add_options[i].script == p_script) { if (add_options[i].script == p_script) {
add_options.remove(i); add_options.remove_at(i);
return; return;
} }
} }

View File

@ -658,7 +658,7 @@ void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_Sel
//Remove the item if invalid //Remove the item if invalid
if (!canvas_item || duplicate || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner())) || (!p_allow_locked && _is_node_locked(canvas_item))) { if (!canvas_item || duplicate || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner())) || (!p_allow_locked && _is_node_locked(canvas_item))) {
r_items.remove(i); r_items.remove_at(i);
i--; i--;
} else { } else {
r_items.write[i].item = canvas_item; r_items.write[i].item = canvas_item;
@ -1045,7 +1045,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
} }
} else { } else {
if (dragged_guide_index >= 0) { if (dragged_guide_index >= 0) {
vguides.remove(dragged_guide_index); vguides.remove_at(dragged_guide_index);
undo_redo->create_action(TTR("Remove Vertical Guide")); undo_redo->create_action(TTR("Remove Vertical Guide"));
if (vguides.is_empty()) { if (vguides.is_empty()) {
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_"); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_vertical_guides_");
@ -1078,7 +1078,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
} }
} else { } else {
if (dragged_guide_index >= 0) { if (dragged_guide_index >= 0) {
hguides.remove(dragged_guide_index); hguides.remove_at(dragged_guide_index);
undo_redo->create_action(TTR("Remove Horizontal Guide")); undo_redo->create_action(TTR("Remove Horizontal Guide"));
if (hguides.is_empty()) { if (hguides.is_empty()) {
undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_"); undo_redo->add_do_method(EditorNode::get_singleton()->get_edited_scene(), "remove_meta", "_edit_horizontal_guides_");

View File

@ -285,7 +285,7 @@ EditorPlugin::AfterGUIInput CollisionPolygon3DEditor::forward_spatial_gui_input(
if (closest_idx >= 0) { if (closest_idx >= 0) {
undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
undo_redo->add_undo_method(node, "set_polygon", poly); undo_redo->add_undo_method(node, "set_polygon", poly);
poly.remove(closest_idx); poly.remove_at(closest_idx);
undo_redo->add_do_method(node, "set_polygon", poly); undo_redo->add_do_method(node, "set_polygon", poly);
undo_redo->add_do_method(this, "_polygon_draw"); undo_redo->add_do_method(this, "_polygon_draw");
undo_redo->add_undo_method(this, "_polygon_draw"); undo_redo->add_undo_method(this, "_polygon_draw");

View File

@ -1238,7 +1238,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
Node3D *item = selection_results[i].item; Node3D *item = selection_results[i].item;
if (item != scene && item->get_owner() != scene && item != scene->get_deepest_editable_node(item)) { if (item != scene && item->get_owner() != scene && item != scene->get_deepest_editable_node(item)) {
//invalid result //invalid result
selection_results.remove(i); selection_results.remove_at(i);
i--; i--;
} }
} }

View File

@ -584,10 +584,10 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
return; return;
} }
uv_create_poly_prev.remove(closest); uv_create_poly_prev.remove_at(closest);
uv_create_uv_prev.remove(closest); uv_create_uv_prev.remove_at(closest);
if (uv_create_colors_prev.size()) { if (uv_create_colors_prev.size()) {
uv_create_colors_prev.remove(closest); uv_create_colors_prev.remove_at(closest);
} }
undo_redo->create_action(TTR("Remove Internal Vertex")); undo_redo->create_action(TTR("Remove Internal Vertex"));
@ -599,7 +599,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->add_undo_method(node, "set_vertex_colors", node->get_vertex_colors()); undo_redo->add_undo_method(node, "set_vertex_colors", node->get_vertex_colors());
for (int i = 0; i < node->get_bone_count(); i++) { for (int i = 0; i < node->get_bone_count(); i++) {
Vector<float> bonew = node->get_bone_weights(i); Vector<float> bonew = node->get_bone_weights(i);
bonew.remove(closest); bonew.remove_at(closest);
undo_redo->add_do_method(node, "set_bone_weights", i, bonew); undo_redo->add_do_method(node, "set_bone_weights", i, bonew);
undo_redo->add_undo_method(node, "set_bone_weights", i, node->get_bone_weights(i)); undo_redo->add_undo_method(node, "set_bone_weights", i, node->get_bone_weights(i));
} }
@ -702,7 +702,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} }
if (erase_index != -1) { if (erase_index != -1) {
polygons.remove(erase_index); polygons.remove_at(erase_index);
undo_redo->create_action(TTR("Remove Custom Polygon")); undo_redo->create_action(TTR("Remove Custom Polygon"));
undo_redo->add_do_method(node, "set_polygons", polygons); undo_redo->add_do_method(node, "set_polygons", polygons);
undo_redo->add_undo_method(node, "set_polygons", node->get_polygons()); undo_redo->add_undo_method(node, "set_polygons", node->get_polygons());

View File

@ -733,7 +733,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
return; return;
} }
rc.remove(p_idx); rc.remove_at(p_idx);
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scripts", rc); EditorSettings::get_singleton()->set_project_metadata("recent_files", "scripts", rc);
_update_recent_scripts(); _update_recent_scripts();
_show_error_dialog(path); _show_error_dialog(path);
@ -785,7 +785,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
for (int i = 0; i < history.size(); i++) { for (int i = 0; i < history.size(); i++) {
if (history[i].control == tselected) { if (history[i].control == tselected) {
history.remove(i); history.remove_at(i);
i--; i--;
history_pos--; history_pos--;
} }

View File

@ -516,7 +516,7 @@ void GenericTilePolygonEditor::_base_control_gui_input(Ref<InputEvent> p_event)
_grab_polygon_point(mb->get_position(), xform, closest_polygon, closest_point); _grab_polygon_point(mb->get_position(), xform, closest_polygon, closest_point);
if (closest_polygon >= 0) { if (closest_polygon >= 0) {
PackedVector2Array old_polygon = polygons[closest_polygon]; PackedVector2Array old_polygon = polygons[closest_polygon];
polygons[closest_polygon].remove(closest_point); polygons[closest_polygon].remove_at(closest_point);
undo_redo->create_action(TTR("Edit Polygons")); undo_redo->create_action(TTR("Edit Polygons"));
if (polygons[closest_polygon].size() < 3) { if (polygons[closest_polygon].size() < 3) {
remove_polygon(closest_polygon); remove_polygon(closest_polygon);
@ -563,7 +563,7 @@ void GenericTilePolygonEditor::_base_control_gui_input(Ref<InputEvent> p_event)
_grab_polygon_point(mb->get_position(), xform, closest_polygon, closest_point); _grab_polygon_point(mb->get_position(), xform, closest_polygon, closest_point);
if (closest_polygon >= 0) { if (closest_polygon >= 0) {
PackedVector2Array old_polygon = polygons[closest_polygon]; PackedVector2Array old_polygon = polygons[closest_polygon];
polygons[closest_polygon].remove(closest_point); polygons[closest_polygon].remove_at(closest_point);
undo_redo->create_action(TTR("Edit Polygons")); undo_redo->create_action(TTR("Edit Polygons"));
if (polygons[closest_polygon].size() < 3) { if (polygons[closest_polygon].size() < 3) {
remove_polygon(closest_polygon); remove_polygon(closest_polygon);
@ -676,7 +676,7 @@ int GenericTilePolygonEditor::add_polygon(Vector<Point2> p_polygon, int p_index)
void GenericTilePolygonEditor::remove_polygon(int p_index) { void GenericTilePolygonEditor::remove_polygon(int p_index) {
ERR_FAIL_INDEX(p_index, (int)polygons.size()); ERR_FAIL_INDEX(p_index, (int)polygons.size());
polygons.remove(p_index); polygons.remove_at(p_index);
if (polygons.size() == 0) { if (polygons.size() == 0) {
button_create->set_pressed(true); button_create->set_pressed(true);

View File

@ -1061,7 +1061,7 @@ void VisualShaderEditor::remove_plugin(const Ref<VisualShaderNodePlugin> &p_plug
void VisualShaderEditor::clear_custom_types() { void VisualShaderEditor::clear_custom_types() {
for (int i = 0; i < add_options.size(); i++) { for (int i = 0; i < add_options.size(); i++) {
if (add_options[i].is_custom) { if (add_options[i].is_custom) {
add_options.remove(i); add_options.remove_at(i);
i--; i--;
} }
} }

View File

@ -1543,7 +1543,7 @@ void ProjectList::remove_project(int p_index, bool p_update_settings) {
} }
memdelete(item.control); memdelete(item.control);
_projects.remove(p_index); _projects.remove_at(p_index);
if (p_update_settings) { if (p_update_settings) {
EditorSettings::get_singleton()->erase("projects/" + item.project_key); EditorSettings::get_singleton()->erase("projects/" + item.project_key);
@ -1733,7 +1733,7 @@ void ProjectList::erase_selected_projects(bool p_delete_project_contents) {
} }
memdelete(item.control); memdelete(item.control);
_projects.remove(i); _projects.remove_at(i);
--i; --i;
} }
} }

View File

@ -486,7 +486,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column
_update_shortcut_events(current_edited_identifier, Array()); _update_shortcut_events(current_edited_identifier, Array());
} }
} else if (type == "event") { } else if (type == "event") {
current_events.remove(current_event_index); current_events.remove_at(current_event_index);
if (is_editing_action) { if (is_editing_action) {
_update_builtin_action(current_edited_identifier, current_events); _update_builtin_action(current_edited_identifier, current_events);
@ -564,7 +564,7 @@ void EditorSettingsDialog::drop_data_fw(const Point2 &p_point, const Variant &p_
Array events = selected->get_parent()->get_meta("events"); Array events = selected->get_parent()->get_meta("events");
Variant event_moved = events[index_moving_from]; Variant event_moved = events[index_moving_from];
events.remove(index_moving_from); events.remove_at(index_moving_from);
events.insert(target_event_index, event_moved); events.insert(target_event_index, event_moved);
String ident = selected->get_parent()->get_meta("shortcut_identifier"); String ident = selected->get_parent()->get_meta("shortcut_identifier");

View File

@ -89,7 +89,7 @@ void AreaBullet::dispatch_callbacks() {
// This object's last shape being removed. // This object's last shape being removed.
overlapping_shape.other_object->on_exit_area(this); overlapping_shape.other_object->on_exit_area(this);
} }
overlapping_shapes.remove(i); // Remove after callback overlapping_shapes.remove_at(i); // Remove after callback
break; break;
case OVERLAP_STATE_INSIDE: { case OVERLAP_STATE_INSIDE: {
if (overlapping_shape.other_object->getType() == TYPE_RIGID_BODY) { if (overlapping_shape.other_object->getType() == TYPE_RIGID_BODY) {
@ -188,7 +188,7 @@ void AreaBullet::remove_object_overlaps(CollisionObjectBullet *p_object) {
// Reverse order so items can be removed. // Reverse order so items can be removed.
for (int i = overlapping_shapes.size() - 1; i >= 0; i--) { for (int i = overlapping_shapes.size() - 1; i >= 0; i--) {
if (overlapping_shapes[i].other_object == p_object) { if (overlapping_shapes[i].other_object == p_object) {
overlapping_shapes.remove(i); overlapping_shapes.remove_at(i);
} }
} }
} }

View File

@ -273,7 +273,7 @@ void RigidCollisionObjectBullet::remove_shape_full(ShapeBullet *p_shape) {
for (int i = shapes.size() - 1; 0 <= i; --i) { for (int i = shapes.size() - 1; 0 <= i; --i) {
if (p_shape == shapes[i].shape) { if (p_shape == shapes[i].shape) {
internal_shape_destroy(i); internal_shape_destroy(i);
shapes.remove(i); shapes.remove_at(i);
} }
} }
reload_shapes(); reload_shapes();
@ -282,7 +282,7 @@ void RigidCollisionObjectBullet::remove_shape_full(ShapeBullet *p_shape) {
void RigidCollisionObjectBullet::remove_shape_full(int p_index) { void RigidCollisionObjectBullet::remove_shape_full(int p_index) {
ERR_FAIL_INDEX(p_index, get_shape_count()); ERR_FAIL_INDEX(p_index, get_shape_count());
internal_shape_destroy(p_index); internal_shape_destroy(p_index);
shapes.remove(p_index); shapes.remove_at(p_index);
reload_shapes(); reload_shapes();
} }

View File

@ -442,7 +442,7 @@ void SoftBodyBullet::unpin_node(int p_node_index) {
} }
const int id = search_node_pinned(p_node_index); const int id = search_node_pinned(p_node_index);
if (-1 != id) { if (-1 != id) {
pinned_nodes.remove(id); pinned_nodes.remove_at(id);
} }
} }

View File

@ -933,7 +933,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_
merge_faces_idx.sort(); merge_faces_idx.sort();
merge_faces_idx.reverse(); merge_faces_idx.reverse();
for (int i = 0; i < merge_faces_idx.size(); ++i) { for (int i = 0; i < merge_faces_idx.size(); ++i) {
faces.remove(merge_faces_idx[i]); faces.remove_at(merge_faces_idx[i]);
} }
if (degenerate_points.size() == 0) { if (degenerate_points.size() == 0) {
@ -983,7 +983,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_
// If new vertex snaps to degenerate vertex, just delete this face. // If new vertex snaps to degenerate vertex, just delete this face.
if (degenerate_idx == opposite_vertex_idx) { if (degenerate_idx == opposite_vertex_idx) {
faces.remove(face_idx); faces.remove_at(face_idx);
// Update index. // Update index.
--face_idx; --face_idx;
break; break;
@ -999,7 +999,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_
right_face.vertex_idx[0] = opposite_vertex_idx; right_face.vertex_idx[0] = opposite_vertex_idx;
right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx]; right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx];
right_face.vertex_idx[2] = degenerate_idx; right_face.vertex_idx[2] = degenerate_idx;
faces.remove(face_idx); faces.remove_at(face_idx);
faces.insert(face_idx, right_face); faces.insert(face_idx, right_face);
faces.insert(face_idx, left_face); faces.insert(face_idx, left_face);
@ -1070,7 +1070,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s
// If new vertex snaps to opposite vertex, just delete this face. // If new vertex snaps to opposite vertex, just delete this face.
if (new_vertex_idx == opposite_vertex_idx) { if (new_vertex_idx == opposite_vertex_idx) {
faces.remove(face_idx); faces.remove_at(face_idx);
// Update index. // Update index.
--face_idx; --face_idx;
break; break;
@ -1092,7 +1092,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s
right_face.vertex_idx[0] = opposite_vertex_idx; right_face.vertex_idx[0] = opposite_vertex_idx;
right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx]; right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx];
right_face.vertex_idx[2] = new_vertex_idx; right_face.vertex_idx[2] = new_vertex_idx;
faces.remove(face_idx); faces.remove_at(face_idx);
faces.insert(face_idx, right_face); faces.insert(face_idx, right_face);
faces.insert(face_idx, left_face); faces.insert(face_idx, left_face);
@ -1162,7 +1162,7 @@ int CSGBrushOperation::Build2DFaces::_insert_point(const Vector2 &p_point) {
// If new vertex snaps to opposite vertex, just delete this face. // If new vertex snaps to opposite vertex, just delete this face.
if (new_vertex_idx == opposite_vertex_idx) { if (new_vertex_idx == opposite_vertex_idx) {
faces.remove(face_idx); faces.remove_at(face_idx);
// Update index. // Update index.
--face_idx; --face_idx;
break; break;
@ -1187,7 +1187,7 @@ int CSGBrushOperation::Build2DFaces::_insert_point(const Vector2 &p_point) {
right_face.vertex_idx[0] = opposite_vertex_idx; right_face.vertex_idx[0] = opposite_vertex_idx;
right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx]; right_face.vertex_idx[1] = face.vertex_idx[face_edge_idx];
right_face.vertex_idx[2] = new_vertex_idx; right_face.vertex_idx[2] = new_vertex_idx;
faces.remove(face_idx); faces.remove_at(face_idx);
faces.insert(face_idx, right_face); faces.insert(face_idx, right_face);
faces.insert(face_idx, left_face); faces.insert(face_idx, left_face);
@ -1222,7 +1222,7 @@ int CSGBrushOperation::Build2DFaces::_insert_point(const Vector2 &p_point) {
new_face.vertex_idx[2] = new_vertex_idx; new_face.vertex_idx[2] = new_vertex_idx;
faces.push_back(new_face); faces.push_back(new_face);
} }
faces.remove(face_idx); faces.remove_at(face_idx);
// No need to check other faces. // No need to check other faces.
break; break;

View File

@ -427,7 +427,7 @@ void GDScript::_add_doc(const DocData::ClassDoc &p_inner_class) {
} else { } else {
for (int i = 0; i < docs.size(); i++) { for (int i = 0; i < docs.size(); i++) {
if (docs[i].name == p_inner_class.name) { if (docs[i].name == p_inner_class.name) {
docs.remove(i); docs.remove_at(i);
break; break;
} }
} }
@ -2131,7 +2131,7 @@ String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_b
const GDScriptParser::ClassNode *inner_class = subclass->members[i].m_class; const GDScriptParser::ClassNode *inner_class = subclass->members[i].m_class;
if (inner_class->identifier->name == extend_classes[0]) { if (inner_class->identifier->name == extend_classes[0]) {
extend_classes.remove(0); extend_classes.remove_at(0);
found = true; found = true;
subclass = inner_class; subclass = inner_class;
break; break;

View File

@ -3414,7 +3414,7 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation)
p_annotation->resolved_arguments.push_back(r); p_annotation->resolved_arguments.push_back(r);
if (error.error != Callable::CallError::CALL_OK) { if (error.error != Callable::CallError::CALL_OK) {
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name)); push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
p_annotation->resolved_arguments.remove(p_annotation->resolved_arguments.size() - 1); p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
return false; return false;
} }
break; break;
@ -3438,7 +3438,7 @@ bool GDScriptParser::validate_annotation_arguments(AnnotationNode *p_annotation)
p_annotation->resolved_arguments.push_back(r); p_annotation->resolved_arguments.push_back(r);
if (error.error != Callable::CallError::CALL_OK) { if (error.error != Callable::CallError::CALL_OK) {
push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name)); push_error(vformat(R"(Expected %s as argument %d of annotation "%s").)", Variant::get_type_name(parameter.type), i + 1, p_annotation->name));
p_annotation->resolved_arguments.remove(p_annotation->resolved_arguments.size() - 1); p_annotation->resolved_arguments.remove_at(p_annotation->resolved_arguments.size() - 1);
return false; return false;
} }
break; break;

View File

@ -115,7 +115,7 @@ Error GDScriptLanguageProtocol::LSPeer::send_data() {
// Response sent // Response sent
if (res_sent >= c_res.size() - 1) { if (res_sent >= c_res.size() - 1) {
res_sent = 0; res_sent = 0;
res_queue.remove(0); res_queue.remove_at(0);
} }
} }
return OK; return OK;

View File

@ -144,7 +144,7 @@ void godot_icall_Array_Insert(Array *ptr, int32_t index, MonoObject *item) {
MonoBoolean godot_icall_Array_Remove(Array *ptr, MonoObject *item) { MonoBoolean godot_icall_Array_Remove(Array *ptr, MonoObject *item) {
int idx = ptr->find(GDMonoMarshal::mono_object_to_variant(item)); int idx = ptr->find(GDMonoMarshal::mono_object_to_variant(item));
if (idx >= 0) { if (idx >= 0) {
ptr->remove(idx); ptr->remove_at(idx);
return true; return true;
} }
return false; return false;
@ -155,7 +155,7 @@ void godot_icall_Array_RemoveAt(Array *ptr, int32_t index) {
GDMonoUtils::set_pending_exception(mono_get_exception_index_out_of_range()); GDMonoUtils::set_pending_exception(mono_get_exception_index_out_of_range());
return; return;
} }
ptr->remove(index); ptr->remove_at(index);
} }
int32_t godot_icall_Array_Resize(Array *ptr, int32_t new_size) { int32_t godot_icall_Array_Resize(Array *ptr, int32_t new_size) {

View File

@ -150,8 +150,8 @@ COMMAND_2(map_set_active, RID, p_map, bool, p_active) {
} else { } else {
int map_index = active_maps.find(map); int map_index = active_maps.find(map);
ERR_FAIL_COND(map_index < 0); ERR_FAIL_COND(map_index < 0);
active_maps.remove(map_index); active_maps.remove_at(map_index);
active_maps_update_id.remove(map_index); active_maps_update_id.remove_at(map_index);
} }
} }
@ -469,8 +469,8 @@ COMMAND_1(free, RID, p_object) {
} }
int map_index = active_maps.find(map); int map_index = active_maps.find(map);
active_maps.remove(map_index); active_maps.remove_at(map_index);
active_maps_update_id.remove(map_index); active_maps_update_id.remove_at(map_index);
map_owner.free(p_object); map_owner.free(p_object);
} else if (region_owner.owns(p_object)) { } else if (region_owner.owns(p_object)) {

View File

@ -2148,7 +2148,7 @@ void TextServerAdvanced::font_remove_texture(RID p_font_rid, const Vector2i &p_s
ERR_FAIL_COND(!_ensure_cache_for_size(fd, size)); ERR_FAIL_COND(!_ensure_cache_for_size(fd, size));
ERR_FAIL_INDEX(p_texture_index, fd->cache[size]->textures.size()); ERR_FAIL_INDEX(p_texture_index, fd->cache[size]->textures.size());
fd->cache[size]->textures.remove(p_texture_index); fd->cache[size]->textures.remove_at(p_texture_index);
} }
void TextServerAdvanced::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { void TextServerAdvanced::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) {

View File

@ -1326,7 +1326,7 @@ void TextServerFallback::font_remove_texture(RID p_font_rid, const Vector2i &p_s
ERR_FAIL_COND(!_ensure_cache_for_size(fd, size)); ERR_FAIL_COND(!_ensure_cache_for_size(fd, size));
ERR_FAIL_INDEX(p_texture_index, fd->cache[size]->textures.size()); ERR_FAIL_INDEX(p_texture_index, fd->cache[size]->textures.size());
fd->cache[size]->textures.remove(p_texture_index); fd->cache[size]->textures.remove_at(p_texture_index);
} }
void TextServerFallback::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { void TextServerFallback::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) {

View File

@ -257,7 +257,7 @@ void UPNP::set_device(int index, Ref<UPNPDevice> device) {
void UPNP::remove_device(int index) { void UPNP::remove_device(int index) {
ERR_FAIL_INDEX(index, devices.size()); ERR_FAIL_INDEX(index, devices.size());
devices.remove(index); devices.remove_at(index);
} }
void UPNP::clear_devices() { void UPNP::clear_devices() {

View File

@ -661,7 +661,7 @@ void VisualScript::custom_signal_remove_argument(const StringName &p_func, int p
ERR_FAIL_COND(instances.size()); ERR_FAIL_COND(instances.size());
ERR_FAIL_COND(!custom_signals.has(p_func)); ERR_FAIL_COND(!custom_signals.has(p_func));
ERR_FAIL_INDEX(p_argidx, custom_signals[p_func].size()); ERR_FAIL_INDEX(p_argidx, custom_signals[p_func].size());
custom_signals[p_func].remove(p_argidx); custom_signals[p_func].remove_at(p_argidx);
} }
int VisualScript::custom_signal_get_argument_count(const StringName &p_func) const { int VisualScript::custom_signal_get_argument_count(const StringName &p_func) const {

View File

@ -1190,7 +1190,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
op->nodes[1] = nullptr; op->nodes[1] = nullptr;
expression.write[i].is_op = false; expression.write[i].is_op = false;
expression.write[i].node = op; expression.write[i].node = op;
expression.remove(i + 1); expression.remove_at(i + 1);
} }
} else { } else {
@ -1222,8 +1222,8 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
//replace all 3 nodes by this operator and make it an expression //replace all 3 nodes by this operator and make it an expression
expression.write[next_op - 1].node = op; expression.write[next_op - 1].node = op;
expression.remove(next_op); expression.remove_at(next_op);
expression.remove(next_op); expression.remove_at(next_op);
} }
} }

View File

@ -253,7 +253,7 @@ String VisualScriptFunction::get_argument_name(int p_argidx) const {
void VisualScriptFunction::remove_argument(int p_argidx) { void VisualScriptFunction::remove_argument(int p_argidx) {
ERR_FAIL_INDEX(p_argidx, arguments.size()); ERR_FAIL_INDEX(p_argidx, arguments.size());
arguments.remove(p_argidx); arguments.remove_at(p_argidx);
ports_changed_notify(); ports_changed_notify();
} }
@ -623,7 +623,7 @@ void VisualScriptLists::remove_input_data_port(int p_argidx) {
ERR_FAIL_INDEX(p_argidx, inputports.size()); ERR_FAIL_INDEX(p_argidx, inputports.size());
inputports.remove(p_argidx); inputports.remove_at(p_argidx);
ports_changed_notify(); ports_changed_notify();
notify_property_list_changed(); notify_property_list_changed();
@ -679,7 +679,7 @@ void VisualScriptLists::remove_output_data_port(int p_argidx) {
ERR_FAIL_INDEX(p_argidx, outputports.size()); ERR_FAIL_INDEX(p_argidx, outputports.size());
outputports.remove(p_argidx); outputports.remove_at(p_argidx);
ports_changed_notify(); ports_changed_notify();
notify_property_list_changed(); notify_property_list_changed();

View File

@ -223,7 +223,7 @@ void AndroidInputHandler::process_touch(int p_event, int p_pointer, const Vector
ev->set_pressed(false); ev->set_pressed(false);
ev->set_position(touch[i].pos); ev->set_position(touch[i].pos);
Input::get_singleton()->parse_input_event(ev); Input::get_singleton()->parse_input_event(ev);
touch.remove(i); touch.remove_at(i);
break; break;
} }

View File

@ -2212,7 +2212,7 @@ void EditorExportPlatformAndroid::get_command_line_flags(const Ref<EditorExportP
Vector<String> command_line_strings = cmdline.strip_edges().split(" "); Vector<String> command_line_strings = cmdline.strip_edges().split(" ");
for (int i = 0; i < command_line_strings.size(); i++) { for (int i = 0; i < command_line_strings.size(); i++) {
if (command_line_strings[i].strip_edges().length() == 0) { if (command_line_strings[i].strip_edges().length() == 0) {
command_line_strings.remove(i); command_line_strings.remove_at(i);
i--; i--;
} }
} }

View File

@ -286,7 +286,7 @@ void DisplayServerX11::_flush_mouse_motion() {
XIDeviceEvent *event_data = (XIDeviceEvent *)event.xcookie.data; XIDeviceEvent *event_data = (XIDeviceEvent *)event.xcookie.data;
if (event_data->evtype == XI_RawMotion) { if (event_data->evtype == XI_RawMotion) {
XFreeEventData(x11_display, &event.xcookie); XFreeEventData(x11_display, &event.xcookie);
polled_events.remove(event_index--); polled_events.remove_at(event_index--);
continue; continue;
} }
XFreeEventData(x11_display, &event.xcookie); XFreeEventData(x11_display, &event.xcookie);

View File

@ -253,7 +253,7 @@ void JoypadLinux::close_joypad(int p_id) {
if (joy.fd != -1) { if (joy.fd != -1) {
close(joy.fd); close(joy.fd);
joy.fd = -1; joy.fd = -1;
attached_devices.remove(attached_devices.find(joy.devpath)); attached_devices.remove_at(attached_devices.find(joy.devpath));
input->joy_connection_changed(p_id, false, ""); input->joy_connection_changed(p_id, false, "");
}; };
} }

View File

@ -75,7 +75,7 @@ Error GLManager_OSX::window_create(DisplayServer::WindowID p_window_id, id p_vie
win.window_view = p_view; win.window_view = p_view;
if (_create_context(win) != OK) { if (_create_context(win) != OK) {
_windows.remove(_windows.size() - 1); _windows.remove_at(_windows.size() - 1);
return FAILED; return FAILED;
} }

View File

@ -264,7 +264,7 @@ void JoypadOSX::_device_removed(IOReturn p_res, IOHIDDeviceRef p_device) {
input->joy_connection_changed(device_list[device].id, false, ""); input->joy_connection_changed(device_list[device].id, false, "");
device_list.write[device].free(); device_list.write[device].free();
device_list.remove(device); device_list.remove_at(device);
} }
static String _hex_str(uint8_t p_byte) { static String _hex_str(uint8_t p_byte) {

View File

@ -376,7 +376,7 @@ Error EditorExportPlatformUWP::export_project(const Ref<EditorExportPreset> &p_p
Vector<String> cl = ((String)p_preset->get("command_line/extra_args")).strip_edges().split(" "); Vector<String> cl = ((String)p_preset->get("command_line/extra_args")).strip_edges().split(" ");
for (int i = 0; i < cl.size(); i++) { for (int i = 0; i < cl.size(); i++) {
if (cl[i].strip_edges().length() == 0) { if (cl[i].strip_edges().length() == 0) {
cl.remove(i); cl.remove_at(i);
i--; i--;
} }
} }

View File

@ -77,7 +77,7 @@ int GLManager_Windows::_find_or_create_display(GLWindow &win) {
if (err != OK) { if (err != OK) {
// not good // not good
// delete the _display? // delete the _display?
_displays.remove(new_display_id); _displays.remove_at(new_display_id);
return -1; return -1;
} }
@ -193,7 +193,7 @@ Error GLManager_Windows::window_create(DisplayServer::WindowID p_window_id, HWND
if (win.gldisplay_id == -1) { if (win.gldisplay_id == -1) {
// release DC? // release DC?
_windows.remove(_windows.size() - 1); _windows.remove_at(_windows.size() - 1);
return FAILED; return FAILED;
} }

View File

@ -97,7 +97,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
while (stream_playbacks.size() > max_polyphony) { while (stream_playbacks.size() > max_polyphony) {
AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]);
stream_playbacks.remove(0); stream_playbacks.remove_at(0);
} }
} }
} }

View File

@ -434,7 +434,7 @@ void CollisionObject2D::shape_owner_remove_shape(uint32_t p_owner, int p_shape)
PhysicsServer2D::get_singleton()->body_remove_shape(rid, index_to_remove); PhysicsServer2D::get_singleton()->body_remove_shape(rid, index_to_remove);
} }
shapes[p_owner].shapes.remove(p_shape); shapes[p_owner].shapes.remove_at(p_shape);
for (KeyValue<uint32_t, ShapeData> &E : shapes) { for (KeyValue<uint32_t, ShapeData> &E : shapes) {
for (int i = 0; i < E.value.shapes.size(); i++) { for (int i = 0; i < E.value.shapes.size(); i++) {

View File

@ -148,7 +148,7 @@ void Line2D::add_point(Vector2 p_pos, int p_atpos) {
} }
void Line2D::remove_point(int i) { void Line2D::remove_point(int i) {
_points.remove(i); _points.remove_at(i);
update(); update();
} }

View File

@ -207,7 +207,7 @@ void NavigationPolygon::set_outline(int p_idx, const Vector<Vector2> &p_outline)
void NavigationPolygon::remove_outline(int p_idx) { void NavigationPolygon::remove_outline(int p_idx) {
ERR_FAIL_INDEX(p_idx, outlines.size()); ERR_FAIL_INDEX(p_idx, outlines.size());
outlines.remove(p_idx); outlines.remove_at(p_idx);
rect_cache_dirty = true; rect_cache_dirty = true;
} }

View File

@ -532,7 +532,7 @@ Vector<float> Polygon2D::get_bone_weights(int p_index) const {
void Polygon2D::erase_bone(int p_idx) { void Polygon2D::erase_bone(int p_idx) {
ERR_FAIL_INDEX(p_idx, bone_weights.size()); ERR_FAIL_INDEX(p_idx, bone_weights.size());
bone_weights.remove(p_idx); bone_weights.remove_at(p_idx);
} }
void Polygon2D::clear_bones() { void Polygon2D::clear_bones() {

View File

@ -165,7 +165,7 @@ void Bone2D::_notification(int p_what) {
if (skeleton) { if (skeleton) {
for (int i = 0; i < skeleton->bones.size(); i++) { for (int i = 0; i < skeleton->bones.size(); i++) {
if (skeleton->bones[i].bone == this) { if (skeleton->bones[i].bone == this) {
skeleton->bones.remove(i); skeleton->bones.remove_at(i);
break; break;
} }
} }

View File

@ -576,7 +576,7 @@ void TileMap::move_layer(int p_layer, int p_to_pos) {
TileMapLayer tl = layers[p_layer]; TileMapLayer tl = layers[p_layer];
layers.insert(p_to_pos, tl); layers.insert(p_to_pos, tl);
layers.remove(p_to_pos < p_layer ? p_layer + 1 : p_layer); layers.remove_at(p_to_pos < p_layer ? p_layer + 1 : p_layer);
_recreate_internals(); _recreate_internals();
notify_property_list_changed(); notify_property_list_changed();
@ -595,7 +595,7 @@ void TileMap::remove_layer(int p_layer) {
// Clear before removing the layer. // Clear before removing the layer.
_clear_internals(); _clear_internals();
layers.remove(p_layer); layers.remove_at(p_layer);
_recreate_internals(); _recreate_internals();
notify_property_list_changed(); notify_property_list_changed();

View File

@ -311,7 +311,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
while (stream_playbacks.size() > max_polyphony) { while (stream_playbacks.size() > max_polyphony) {
AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]);
stream_playbacks.remove(0); stream_playbacks.remove_at(0);
} }
} }
} }

View File

@ -628,7 +628,7 @@ void CollisionObject3D::shape_owner_remove_shape(uint32_t p_owner, int p_shape)
--debug_shapes_count; --debug_shapes_count;
} }
shapes[p_owner].shapes.remove(p_shape); shapes[p_owner].shapes.remove_at(p_shape);
for (KeyValue<uint32_t, ShapeData> &E : shapes) { for (KeyValue<uint32_t, ShapeData> &E : shapes) {
for (int i = 0; i < E.value.shapes.size(); i++) { for (int i = 0; i < E.value.shapes.size(); i++) {

View File

@ -478,7 +478,7 @@ void Node3D::remove_gizmo(Ref<Node3DGizmo> p_gizmo) {
int idx = data.gizmos.find(p_gizmo); int idx = data.gizmos.find(p_gizmo);
if (idx != -1) { if (idx != -1) {
p_gizmo->free(); p_gizmo->free();
data.gizmos.remove(idx); data.gizmos.remove_at(idx);
} }
#endif #endif
} }

View File

@ -633,7 +633,7 @@ void Skeleton3D::remove_bone_child(int p_bone, int p_child) {
int child_idx = bones[p_bone].child_bones.find(p_child); int child_idx = bones[p_bone].child_bones.find(p_child);
if (child_idx >= 0) { if (child_idx >= 0) {
bones.write[p_bone].child_bones.remove(child_idx); bones.write[p_bone].child_bones.remove_at(child_idx);
} else { } else {
WARN_PRINT("Cannot remove child bone: Child bone not found."); WARN_PRINT("Cannot remove child bone: Child bone not found.");
} }

View File

@ -773,7 +773,7 @@ void SoftDynamicBody3D::_reset_points_offsets() {
void SoftDynamicBody3D::_remove_pinned_point(int p_point_index) { void SoftDynamicBody3D::_remove_pinned_point(int p_point_index) {
const int id(_has_pinned_point(p_point_index)); const int id(_has_pinned_point(p_point_index));
if (-1 != id) { if (-1 != id) {
pinned_points.remove(id); pinned_points.remove_at(id);
} }
} }

View File

@ -134,7 +134,7 @@ void AnimationNodeBlendSpace2D::remove_blend_point(int p_point) {
} }
} }
if (erase) { if (erase) {
triangles.remove(i); triangles.remove_at(i);
i--; i--;
} }
@ -224,7 +224,7 @@ int AnimationNodeBlendSpace2D::get_triangle_point(int p_triangle, int p_point) {
void AnimationNodeBlendSpace2D::remove_triangle(int p_triangle) { void AnimationNodeBlendSpace2D::remove_triangle(int p_triangle) {
ERR_FAIL_INDEX(p_triangle, triangles.size()); ERR_FAIL_INDEX(p_triangle, triangles.size());
triangles.remove(p_triangle); triangles.remove_at(p_triangle);
} }
int AnimationNodeBlendSpace2D::get_triangle_count() const { int AnimationNodeBlendSpace2D::get_triangle_count() const {

View File

@ -464,7 +464,7 @@ double AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_s
} }
if (path.size()) { //if it came from path, remove path if (path.size()) { //if it came from path, remove path
path.remove(0); path.remove_at(0);
} }
current = next; current = next;
if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_SYNC) { if (switch_mode == AnimationNodeStateMachineTransition::SWITCH_MODE_SYNC) {
@ -624,7 +624,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) {
for (int i = 0; i < transitions.size(); i++) { for (int i = 0; i < transitions.size(); i++) {
if (transitions[i].from == p_name || transitions[i].to == p_name) { if (transitions[i].from == p_name || transitions[i].to == p_name) {
transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed)); transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(i); transitions.remove_at(i);
i--; i--;
} }
} }
@ -751,7 +751,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons
for (int i = 0; i < transitions.size(); i++) { for (int i = 0; i < transitions.size(); i++) {
if (transitions[i].from == p_from && transitions[i].to == p_to) { if (transitions[i].from == p_from && transitions[i].to == p_to) {
transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed)); transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(i); transitions.remove_at(i);
return; return;
} }
} }
@ -764,7 +764,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons
void AnimationNodeStateMachine::remove_transition_by_index(int p_transition) { void AnimationNodeStateMachine::remove_transition_by_index(int p_transition) {
ERR_FAIL_INDEX(p_transition, transitions.size()); ERR_FAIL_INDEX(p_transition, transitions.size());
transitions.write[p_transition].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed)); transitions.write[p_transition].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(p_transition); transitions.remove_at(p_transition);
/*if (playing) { /*if (playing) {
path.clear(); path.clear();
}*/ }*/

View File

@ -329,7 +329,7 @@ void AnimationNode::set_input_name(int p_input, const String &p_name) {
void AnimationNode::remove_input(int p_index) { void AnimationNode::remove_input(int p_index) {
ERR_FAIL_INDEX(p_index, inputs.size()); ERR_FAIL_INDEX(p_index, inputs.size());
inputs.remove(p_index); inputs.remove_at(p_index);
emit_changed(); emit_changed();
} }

View File

@ -143,7 +143,7 @@ void AudioStreamPlayer::play(float p_from_pos) {
set_process_internal(true); set_process_internal(true);
while (stream_playbacks.size() > max_polyphony) { while (stream_playbacks.size() > max_polyphony) {
AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]);
stream_playbacks.remove(0); stream_playbacks.remove_at(0);
} }
} }

View File

@ -2395,7 +2395,7 @@ void CodeEdit::_update_delimiter_cache(int p_from_line, int p_to_line) {
if (start_line != end_line) { if (start_line != end_line) {
if (p_to_line < p_from_line) { if (p_to_line < p_from_line) {
for (int i = end_line; i > start_line; i--) { for (int i = end_line; i > start_line; i--) {
delimiter_cache.remove(i); delimiter_cache.remove_at(i);
} }
} else { } else {
for (int i = start_line; i < end_line; i++) { for (int i = start_line; i < end_line; i++) {
@ -2632,7 +2632,7 @@ void CodeEdit::_remove_delimiter(const String &p_start_key, DelimiterType p_type
break; break;
} }
delimiters.remove(i); delimiters.remove_at(i);
if (!setting_delimiters) { if (!setting_delimiters) {
delimiter_cache.clear(); delimiter_cache.clear();
_update_delimiter_cache(); _update_delimiter_cache();
@ -2673,7 +2673,7 @@ void CodeEdit::_set_delimiters(const TypedArray<String> &p_delimiters, Delimiter
void CodeEdit::_clear_delimiters(DelimiterType p_type) { void CodeEdit::_clear_delimiters(DelimiterType p_type) {
for (int i = delimiters.size() - 1; i >= 0; i--) { for (int i = delimiters.size() - 1; i >= 0; i--) {
if (delimiters[i].type == p_type) { if (delimiters[i].type == p_type) {
delimiters.remove(i); delimiters.remove_at(i);
} }
} }
delimiter_cache.clear(); delimiter_cache.clear();

View File

@ -89,7 +89,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event; Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed() && k->get_keycode() == Key::KEY_DELETE && grabbed != -1) { if (k.is_valid() && k->is_pressed() && k->get_keycode() == Key::KEY_DELETE && grabbed != -1) {
points.remove(grabbed); points.remove_at(grabbed);
grabbed = -1; grabbed = -1;
grabbing = false; grabbing = false;
update(); update();
@ -109,7 +109,7 @@ void GradientEdit::gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) { if (mb.is_valid() && mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) {
grabbed = _get_point_from_pos(mb->get_position().x); grabbed = _get_point_from_pos(mb->get_position().x);
if (grabbed != -1) { if (grabbed != -1) {
points.remove(grabbed); points.remove_at(grabbed);
grabbed = -1; grabbed = -1;
grabbing = false; grabbing = false;
update(); update();

View File

@ -381,7 +381,7 @@ void ItemList::move_item(int p_from_idx, int p_to_idx) {
} }
Item item = items[p_from_idx]; Item item = items[p_from_idx];
items.remove(p_from_idx); items.remove_at(p_from_idx);
items.insert(p_to_idx, item); items.insert(p_to_idx, item);
update(); update();
@ -404,7 +404,7 @@ int ItemList::get_item_count() const {
void ItemList::remove_item(int p_idx) { void ItemList::remove_item(int p_idx) {
ERR_FAIL_INDEX(p_idx, items.size()); ERR_FAIL_INDEX(p_idx, items.size());
items.remove(p_idx); items.remove_at(p_idx);
if (current == p_idx) { if (current == p_idx) {
current = -1; current = -1;
} }

View File

@ -1403,7 +1403,7 @@ void PopupMenu::remove_item(int p_idx) {
_unref_shortcut(items[p_idx].shortcut); _unref_shortcut(items[p_idx].shortcut);
} }
items.remove(p_idx); items.remove_at(p_idx);
control->update(); control->update();
child_controls_changed(); child_controls_changed();
} }

View File

@ -2334,7 +2334,7 @@ void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_sub
p_item->parent->subitems.erase(p_item); p_item->parent->subitems.erase(p_item);
// If a newline was erased, all lines AFTER the newline need to be decremented. // If a newline was erased, all lines AFTER the newline need to be decremented.
if (p_item->type == ITEM_NEWLINE) { if (p_item->type == ITEM_NEWLINE) {
current_frame->lines.remove(p_line); current_frame->lines.remove_at(p_line);
for (int i = 0; i < current->subitems.size(); i++) { for (int i = 0; i < current->subitems.size(); i++) {
if (current->subitems[i]->line > p_subitem_line) { if (current->subitems[i]->line > p_subitem_line) {
current->subitems[i]->line--; current->subitems[i]->line--;
@ -2423,7 +2423,7 @@ bool RichTextLabel::remove_line(const int p_line) {
} }
if (!had_newline) { if (!had_newline) {
current_frame->lines.remove(p_line); current_frame->lines.remove_at(p_line);
if (current_frame->lines.size() == 0) { if (current_frame->lines.size() == 0) {
current_frame->lines.resize(1); current_frame->lines.resize(1);
} }
@ -3527,7 +3527,7 @@ void RichTextLabel::append_text(const String &p_bbcode) {
pos = brk_pos + 1; pos = brk_pos + 1;
} else { } else {
String identifier = expr[0]; String identifier = expr[0];
expr.remove(0); expr.remove_at(0);
Dictionary properties = parse_expressions_for_values(expr); Dictionary properties = parse_expressions_for_values(expr);
Ref<RichTextEffect> effect = _get_custom_effect_by_code(identifier); Ref<RichTextEffect> effect = _get_custom_effect_by_code(identifier);

Some files were not shown because too many files have changed in this diff Show More