From 914993f31b9a5208b5b2fbfa38c22c5c5b0ef13d Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 12 Feb 2023 13:49:44 +0100 Subject: [PATCH] putil: Fix SimpleHashMap error reporting at static init time --- panda/src/putil/simpleHashMap.I | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/panda/src/putil/simpleHashMap.I b/panda/src/putil/simpleHashMap.I index 62809b4ffe..4f322faa86 100644 --- a/panda/src/putil/simpleHashMap.I +++ b/panda/src/putil/simpleHashMap.I @@ -532,11 +532,10 @@ validate() const { size_t index = (size_t)index_array[slot]; ++count; if (index >= _num_entries) { - util_cat.error() + write(util_cat->error() << "SimpleHashMap " << this << " is invalid: slot " << slot << " contains index " << index << " which is past the end of the" - " table\n"; - write(util_cat.error(false)); + " table\n"); return false; } nassertd(index < _num_entries) continue; @@ -546,21 +545,19 @@ validate() const { wants_slot = next_hash(wants_slot); } if (wants_slot != slot) { - util_cat.error() + write(util_cat->error() << "SimpleHashMap " << this << " is invalid: key " << _table[index]._key << " should be in slot " << wants_slot - << " instead of " << slot << " (ideal is " << ideal_slot << ")\n"; - write(util_cat.error(false)); + << " instead of " << slot << " (ideal is " << ideal_slot << ")\n"); return false; } } } if (count != _num_entries) { - util_cat.error() + write(util_cat->error() << "SimpleHashMap " << this << " is invalid: reports " << _num_entries - << " entries, actually has " << count << "\n"; - write(util_cat.error(false)); + << " entries, actually has " << count << "\n"); return false; }