]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
splay: rename Curl_splayremovebyaddr to Curl_splayremove
authorDaniel Stenberg <daniel@haxx.se>
Mon, 30 Nov 2020 16:51:26 +0000 (17:51 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 1 Dec 2020 07:09:51 +0000 (08:09 +0100)
... and remove the old unused proto for the old Curl_splayremove
version.

Closes #6269

lib/multi.c
lib/splay.c
lib/splay.h
tests/unit/unit1309.c

index d5337e43e53d9c6a3bbfc79c60607ade5ccc843f..adfbe3f531c02c584d95f0ea611752caf5d43b30 100644 (file)
@@ -3375,9 +3375,8 @@ void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id)
 
     /* Since this is an updated time, we must remove the previous entry from
        the splay tree first and then re-add the new value */
-    rc = Curl_splayremovebyaddr(multi->timetree,
-                                &data->state.timenode,
-                                &multi->timetree);
+    rc = Curl_splayremove(multi->timetree, &data->state.timenode,
+                          &multi->timetree);
     if(rc)
       infof(data, "Internal error removing splay node = %d\n", rc);
   }
@@ -3423,9 +3422,8 @@ void Curl_expire_clear(struct Curl_easy *data)
     struct Curl_llist *list = &data->state.timeoutlist;
     int rc;
 
-    rc = Curl_splayremovebyaddr(multi->timetree,
-                                &data->state.timenode,
-                                &multi->timetree);
+    rc = Curl_splayremove(multi->timetree, &data->state.timenode,
+                          &multi->timetree);
     if(rc)
       infof(data, "Internal error clearing splay node = %d\n", rc);
 
index 08a72131943ac4f1950725ad6db58475cb47d01c..98baf5d871c22f0b4c0cd3c9b0caab092b9491d8 100644 (file)
@@ -206,9 +206,9 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i,
  *
  * @unittest: 1309
  */
-int Curl_splayremovebyaddr(struct Curl_tree *t,
-                           struct Curl_tree *removenode,
-                           struct Curl_tree **newroot)
+int Curl_splayremove(struct Curl_tree *t,
+                     struct Curl_tree *removenode,
+                     struct Curl_tree **newroot)
 {
   static const struct curltime KEY_NOTUSED = {
     (time_t)-1, (unsigned int)-1
index e1a1fec885c71f37d9ffc2ce9c9f921fa72b0429..eb9f65f1e07e491b2ba17475a0d20511fed48442 100644 (file)
@@ -40,19 +40,13 @@ struct Curl_tree *Curl_splayinsert(struct curltime key,
                                    struct Curl_tree *t,
                                    struct Curl_tree *newnode);
 
-#if 0
-struct Curl_tree *Curl_splayremove(struct curltime key,
-                                   struct Curl_tree *t,
-                                   struct Curl_tree **removed);
-#endif
-
 struct Curl_tree *Curl_splaygetbest(struct curltime key,
                                     struct Curl_tree *t,
                                     struct Curl_tree **removed);
 
-int Curl_splayremovebyaddr(struct Curl_tree *t,
-                           struct Curl_tree *removenode,
-                           struct Curl_tree **newroot);
+int Curl_splayremove(struct Curl_tree *t,
+                     struct Curl_tree *removenode,
+                     struct Curl_tree **newroot);
 
 #define Curl_splaycomparekeys(i,j) ( ((i.tv_sec)  < (j.tv_sec)) ? -1 : \
                                    ( ((i.tv_sec)  > (j.tv_sec)) ?  1 : \
index 1bd4a635d5a31bf4a4e19b03a2bd64bc85c833be..5a2c154b0d438ce42116e5cbb4c1980219ca8600 100644 (file)
@@ -99,7 +99,7 @@ UNITTEST_START
     splayprint(root, 0, 1);
     printf("remove pointer %d, payload %zu\n", rem,
            *(size_t *)nodes[rem].payload);
-    rc = Curl_splayremovebyaddr(root, &nodes[rem], &root);
+    rc = Curl_splayremove(root, &nodes[rem], &root);
     if(rc) {
       /* failed! */
       printf("remove %d failed!\n", rem);