Make VMap::find_nearest return -1 when empty

(cherry picked from commit 3057b19daa)
This commit is contained in:
Haoyu Qiu 2022-02-16 16:12:30 +08:00 committed by Rémi Verschelde
parent 9135074cc2
commit 0f76143444
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -141,6 +141,9 @@ public:
}
int find_nearest(const T &p_val) const {
if (_cowdata.empty()) {
return -1;
}
bool exact;
return _find(p_val, exact);
}