summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-10-17 10:13:40 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-10-17 10:13:40 -0700
commit4230292830e1eead17c5910dc15e008d0b34d247 (patch)
tree5526bd31348db430236b3bdb23f4fc81c211d4d2 /src/pugixml.cpp
parent67702277e60a34bb3cd70691a8823d7ce528c8bf (diff)
Add compact_hash_table assertions
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 3790313..c7ccaee 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -299,7 +299,7 @@ PUGI__NS_BEGIN
void** insert(const void* key)
{
assert(key);
- assert(_count < _capacity * 3 / 4);
+ assert(_capacity != 0 && _count < _capacity - _capacity / 4);
size_t hashmod = _capacity - 1;
size_t bucket = hash(key) & hashmod;
@@ -384,6 +384,8 @@ PUGI__NS_BEGIN
_capacity = rt._capacity;
_items = rt._items;
+ assert(_count == rt._count);
+
return true;
}