Make VMap::find_nearest return -1 when empty
(cherry picked from commit 3057b19daa
)
This commit is contained in:
parent
9135074cc2
commit
0f76143444
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue