Skip to content

Commit 2d7941d

Browse files
authored
Merge pull request #1711 from BenLubar/vector-bsearch-const
Make Vector<T>::bsearch use a const receiver
2 parents f47a4d5 + 479d206 commit 2d7941d

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
@@ -124,14 +124,14 @@ class Vector {
124124
sorter.sort(data, len);
125125
}
126126

127-
Size bsearch(const T &p_value, bool p_before) {
127+
Size bsearch(const T &p_value, bool p_before) const {
128128
return bsearch_custom<_DefaultComparator<T>>(p_value, p_before);
129129
}
130130

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

137137
Vector<T> duplicate() {

0 commit comments

Comments
 (0)