From: robertc <> Date: Wed, 3 Sep 2003 04:57:00 +0000 (+0000) Subject: Summary: the always-finsh-compile-testing splay fixup. X-Git-Tag: SQUID_3_0_PRE4~1223 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bcafc95812ab1d5874564f9f08b63364e4c773a;p=thirdparty%2Fsquid.git Summary: the always-finsh-compile-testing splay fixup. Keywords: The splay fix previous was incomplete.. --- diff --git a/include/splay.h b/include/splay.h index bc1bb0338a..bec5f20ba5 100644 --- a/include/splay.h +++ b/include/splay.h @@ -1,5 +1,5 @@ /* - * $Id: splay.h,v 1.23 2003/09/02 21:45:48 robertc Exp $ + * $Id: splay.h,v 1.24 2003/09/02 22:57:00 robertc Exp $ */ #ifndef SQUID_SPLAY_H @@ -44,7 +44,7 @@ public: typedef void SPLAYWALKEE(Value const & nodedata, void *state); static void DefaultFree (Value &aValue) {delete aValue;} - SplayNode (); + SplayNode (Value const &); Value data; mutable SplayNode *left; mutable SplayNode *right; @@ -107,7 +107,8 @@ SQUIDCEXTERN void splay_walk(splayNode *, splayNode::SPLAYWALKEE *, void *caller /* inline methods */ template -SplayNode::SplayNode () : data(NULL), left(NULL), right (NULL) {} +SplayNode::SplayNode (Value const &someData) : data(someData), left(NULL), right (NULL) {} + template void SplayNode::walk(SPLAYWALKEE * walkee, void *state) @@ -196,8 +197,7 @@ SplayNode * SplayNode::insert(Value dataToInsert, SPLAYCMP * compare) { /* create node to insert */ - SplayNode *newNode = new SplayNode; - newNode->data = dataToInsert; + SplayNode *newNode = new SplayNode(dataToInsert); if (this == NULL) { splayLastResult = -1; @@ -234,7 +234,7 @@ SplayNode::splay(Value const &dataToFind, SPLAYCMP * compare) const return NULL; } - SplayNode N; + SplayNode N(dataToFind); SplayNode *l; SplayNode *r; SplayNode *y;