]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed Splay::insert
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 2 Jan 2015 10:00:35 +0000 (11:00 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 2 Jan 2015 10:00:35 +0000 (11:00 +0100)
include/splay.h

index 78093798bd454da6898bbe2a848735bcfae50be6..d6bfe3ebabf6ae279904f26307f4d8634366c125 100644 (file)
@@ -318,7 +318,10 @@ void
 Splay<V>::insert(Value const &value, SPLAYCMP *compare)
 {
     assert (!find (value, compare));
-    head = head->insert(value, compare);
+    if (head == NULL)
+        head = new SplayNode<V>(value);
+    else
+        head = head->insert(value, compare);
     ++elements;
 }