From 006b562c49414fedca3dd57e6d69db7e5d56bbbd Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Fri, 2 Jan 2015 11:00:35 +0100 Subject: [PATCH] Fixed Splay::insert --- include/splay.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/splay.h b/include/splay.h index 78093798bd..d6bfe3ebab 100644 --- a/include/splay.h +++ b/include/splay.h @@ -318,7 +318,10 @@ void Splay::insert(Value const &value, SPLAYCMP *compare) { assert (!find (value, compare)); - head = head->insert(value, compare); + if (head == NULL) + head = new SplayNode(value); + else + head = head->insert(value, compare); ++elements; } -- 2.47.3