diff options
author | Marc <marc.gilleron@gmail.com> | 2021-01-31 20:03:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 20:03:47 +0000 |
commit | 05ba977cc60653952b73dc03498ebc7a93cef120 (patch) | |
tree | 1a4c1b149b800b181d32500ef2759a64671f806d | |
parent | e76efdd3ab18092f65a2bea8ca92e604420fce2f (diff) | |
parent | 38c9b624db45fd9f00515c28ed6c72edb913b980 (diff) | |
download | redot-cpp-05ba977cc60653952b73dc03498ebc7a93cef120.tar.gz |
Merge pull request #485 from colugomusic/fix-array-const
Fix constness of Array::find, Array::find_last and Array::rfind
-rw-r--r-- | include/core/Array.hpp | 6 | ||||
-rw-r--r-- | src/core/Array.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/core/Array.hpp b/include/core/Array.hpp index 3d13914..5227fea 100644 --- a/include/core/Array.hpp +++ b/include/core/Array.hpp @@ -104,9 +104,9 @@ public: Variant back() const; - int find(const Variant &what, const int from = 0); + int find(const Variant &what, const int from = 0) const; - int find_last(const Variant &what); + int find_last(const Variant &what) const; bool has(const Variant &what) const; @@ -132,7 +132,7 @@ public: void resize(const int size); - int rfind(const Variant &what, const int from = -1); + int rfind(const Variant &what, const int from = -1) const; void sort(); diff --git a/src/core/Array.cpp b/src/core/Array.cpp index 676eba5..b63e935 100644 --- a/src/core/Array.cpp +++ b/src/core/Array.cpp @@ -92,11 +92,11 @@ Variant Array::back() const { return *(Variant *)&v; } -int Array::find(const Variant &what, const int from) { +int Array::find(const Variant &what, const int from) const { return godot::api->godot_array_find(&_godot_array, (godot_variant *)&what, from); } -int Array::find_last(const Variant &what) { +int Array::find_last(const Variant &what) const { return godot::api->godot_array_find_last(&_godot_array, (godot_variant *)&what); } @@ -146,7 +146,7 @@ void Array::resize(const int size) { godot::api->godot_array_resize(&_godot_array, size); } -int Array::rfind(const Variant &what, const int from) { +int Array::rfind(const Variant &what, const int from) const { return godot::api->godot_array_rfind(&_godot_array, (godot_variant *)&what, from); } |