[PATCH] util: Get rid of virStringListLen()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It does exactly the same thing as virStringListLenght() and it's used in
one place only.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/util/virpolkit.c |  2 +-
 src/util/virstring.c | 14 --------------
 src/util/virstring.h |  2 --
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c
index ae7ec132b229..8da91f2cdb0a 100644
--- a/src/util/virpolkit.c
+++ b/src/util/virpolkit.c
@@ -90,7 +90,7 @@ int virPolkitCheckAuth(const char *actionid,
                           "start-time", "t", startTime,
                           "uid", "i", (int)uid,
                           actionid,
-                          virStringListLen(details) / 2,
+                          virStringListLength(details) / 2,
                           details,
                           allowInteraction,
                           "" /* cancellation ID */) < 0)
diff --git a/src/util/virstring.c b/src/util/virstring.c
index 8cd4bdd16ece..fc4f5ba7e641 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -208,20 +208,6 @@ virStringFreeListCount(char **strings,
 }


-size_t virStringListLen(const char **strings)
-{
-    size_t i = 0;
-
-    if (!strings)
-        return 0;
-
-    while (strings[i] != NULL)
-        i++;
-
-    return i;
-}
-
-
 bool
 virStringArrayHasString(char **strings, const char *needle)
 {
diff --git a/src/util/virstring.h b/src/util/virstring.h
index df5928fb1363..cdf10588259c 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -44,8 +44,6 @@ char *virStringJoin(const char **strings,
 void virStringFreeList(char **strings);
 void virStringFreeListCount(char **strings, size_t count);

-size_t virStringListLen(const char **strings);
-
 bool virStringArrayHasString(char **strings, const char *needle);
 char *virStringGetFirstWithPrefix(char **strings, const char *prefix)
     ATTRIBUTE_NONNULL(2);
-- 
2.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]