diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-16 11:01:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 11:01:13 +0100 |
commit | f5b9cbaff6f0a058d08187b3124948ae68848cd0 (patch) | |
tree | 621cb55edb01846f9fcaf49cb5f685881ad2c761 /core | |
parent | a269e78344d8f58696c43b397aa5b70ff864e1aa (diff) | |
parent | 3057b19daa3a9c2e6fbd1da97822e8c1f795dcdc (diff) |
Merge pull request #58176 from timothyqiu/find-nearest
Diffstat (limited to 'core')
-rw-r--r-- | core/templates/vmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/templates/vmap.h b/core/templates/vmap.h index 013c4e4262..37622258db 100644 --- a/core/templates/vmap.h +++ b/core/templates/vmap.h @@ -142,6 +142,9 @@ public: } int find_nearest(const T &p_val) const { + if (_cowdata.is_empty()) { + return -1; + } bool exact; return _find(p_val, exact); } |