]> granicus.if.org Git - curl/commitdiff
minor fix to make Curl_splayremove() return a NULL as "removed" in case
authorDaniel Stenberg <daniel@haxx.se>
Wed, 24 May 2006 16:11:31 +0000 (16:11 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 24 May 2006 16:11:31 +0000 (16:11 +0000)
nothing matched fine

lib/splay.c

index 0ea078b6c003811cfc4a3d54d361c1a8f7c8d1ed..6278089d1cec104c48cfb7fa8c561e9b1360eae1 100644 (file)
@@ -143,6 +143,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t,
 {
   struct Curl_tree *x;
 
+  *removed = NULL; /* default to no removed */
+
   if (t==NULL)
     return NULL;
 
@@ -174,10 +176,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t,
 
     return x;
   }
-  else {
-    *removed = NULL; /* no match */
+  else
     return t;                         /* It wasn't there */
-  }
 }
 
 /* Finds and deletes the best-fit node from the tree. Return a pointer to the