summaryrefslogtreecommitdiff
path: root/core/templates
diff options
context:
space:
mode:
authorNathan Franke <me@nathan.sh>2022-05-25 11:39:00 -0500
committerNathan Franke <me@nathan.sh>2022-05-25 13:36:45 -0500
commit77c8f271e7ca8ab6374abdc7470d6a6f6afa18d4 (patch)
treeb2894e8a5125cf7fc04adbdbd7fc66f69cc867be /core/templates
parent410b6b5f7d23638997aa7de3faf3b382c95e7fc3 (diff)
use ERR_FAIL_INDEX when preferred
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/bin_sorted_array.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/templates/bin_sorted_array.h b/core/templates/bin_sorted_array.h
index 59ac4cdaa1..d928bd7a82 100644
--- a/core/templates/bin_sorted_array.h
+++ b/core/templates/bin_sorted_array.h
@@ -61,7 +61,7 @@ public:
}
uint64_t move(uint64_t p_idx, uint64_t p_bin) {
- ERR_FAIL_COND_V(p_idx >= array.size(), -1);
+ ERR_FAIL_UNSIGNED_INDEX_V(p_idx, array.size(), -1);
uint64_t current_bin = bin_limits.size() - 1;
while (p_idx > bin_limits[current_bin]) {
@@ -113,7 +113,7 @@ public:
}
void remove_at(uint64_t p_idx) {
- ERR_FAIL_COND(p_idx >= array.size());
+ ERR_FAIL_UNSIGNED_INDEX(p_idx, array.size());
uint64_t new_idx = move(p_idx, 0);
uint64_t swap_idx = array.size() - 1;