You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Remove unneeded read_only check for Array const operator.
This commit is contained in:
@@ -88,11 +88,11 @@ Array::Iterator Array::end() {
|
||||
}
|
||||
|
||||
Array::ConstIterator Array::begin() const {
|
||||
return ConstIterator(_p->array.ptr(), _p->read_only);
|
||||
return ConstIterator(_p->array.ptr());
|
||||
}
|
||||
|
||||
Array::ConstIterator Array::end() const {
|
||||
return ConstIterator(_p->array.ptr() + _p->array.size(), _p->read_only);
|
||||
return ConstIterator(_p->array.ptr() + _p->array.size());
|
||||
}
|
||||
|
||||
Variant &Array::operator[](int p_idx) {
|
||||
@@ -104,10 +104,6 @@ Variant &Array::operator[](int p_idx) {
|
||||
}
|
||||
|
||||
const Variant &Array::operator[](int p_idx) const {
|
||||
if (unlikely(_p->read_only)) {
|
||||
*_p->read_only = _p->array[p_idx];
|
||||
return *_p->read_only;
|
||||
}
|
||||
return _p->array[p_idx];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user