Skip to content

Commit 479d206

Browse files
committed
make Vector<T>::bsearch use a const receiver
1 parent 5eb6e6b commit 479d206

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/godot_cpp/templates/vector.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ class Vector {
122122
sorter.sort(data, len);
123123
}
124124

125-
Size bsearch(const T &p_value, bool p_before) {
125+
Size bsearch(const T &p_value, bool p_before) const {
126126
return bsearch_custom<_DefaultComparator<T>>(p_value, p_before);
127127
}
128128

129129
template <typename Comparator, typename Value, typename... Args>
130-
Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) {
130+
Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) const {
131131
SearchArray<T, Comparator> search{ args... };
132-
return search.bisect(ptrw(), size(), p_value, p_before);
132+
return search.bisect(ptr(), size(), p_value, p_before);
133133
}
134134

135135
Vector<T> duplicate() {

0 commit comments

Comments
 (0)