[PATCH 23/40] virStringListGetFirstWithPrefix: Remove unused helper

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

 



This is a uncommon and trivial operation, so having an utility function
for it is pointless.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/libvirt_private.syms |  1 -
 src/util/virstring.c     | 18 ------------------
 src/util/virstring.h     |  3 ---
 3 files changed, 22 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 86380d0853..d215665ee0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3241,7 +3241,6 @@ virStringHasSuffix;
 virStringIsEmpty;
 virStringIsPrintable;
 virStringListFreeCount;
-virStringListGetFirstWithPrefix;
 virStringListHasString;
 virStringListJoin;
 virStringListLength;
diff --git a/src/util/virstring.c b/src/util/virstring.c
index bf861d4847..516b898223 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -238,24 +238,6 @@ virStringListHasString(const char **strings,
     return false;
 }

-char *
-virStringListGetFirstWithPrefix(char **strings,
-                                const char *prefix)
-{
-    size_t i = 0;
-
-    if (!strings)
-        return NULL;
-
-    while (strings[i]) {
-        if (STRPREFIX(strings[i], prefix))
-            return strings[i] + strlen(prefix);
-        i++;
-    }
-
-    return NULL;
-}
-
 /* Like strtol, but produce an "int" result, and check more carefully.
    Return 0 upon success;  return -1 to indicate failure.
    When END_PTR is NULL, the byte after the final valid digit must be NUL.
diff --git a/src/util/virstring.h b/src/util/virstring.h
index 00c669b43b..4705b9c141 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -45,9 +45,6 @@ void virStringListFreeCount(char **strings,

 bool virStringListHasString(const char **strings,
                             const char *needle);
-char *virStringListGetFirstWithPrefix(char **strings,
-                                      const char *prefix)
-    ATTRIBUTE_NONNULL(2);

 int virStrToLong_i(char const *s,
                    char **end_ptr,
-- 
2.29.2




[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]

  Powered by Linux