]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/wordlist.cc
Implement iterator for wordlist (#1729)
[thirdparty/squid.git] / src / wordlist.cc
index ce98e8047f661ff81c4900abb55e5847a8993c57..4be7aeffb59d7a46f5a24e6823f59480d8412bbc 100644 (file)
@@ -34,21 +34,8 @@ wordlistAdd(wordlist ** list, const char *key)
 void
 wordlistCat(const wordlist * w, MemBuf * mb)
 {
-    while (nullptr != w) {
-        mb->appendf("%s\n", w->key);
-        w = w->next;
-    }
-}
-
-SBufList
-ToSBufList(wordlist *wl)
-{
-    SBufList rv;
-    while (wl != nullptr) {
-        rv.push_back(SBuf(wl->key));
-        wl = wl->next;
-    }
-    return rv;
+    for (const auto &word: *w)
+        mb->appendf("%s\n", word);
 }
 
 char *