]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - include/CbDataList.h
SourceFormat Enforcement
[thirdparty/squid.git] / include / CbDataList.h
index 8e221e20e20e17390400005001355e526712383c..a7376416e25ccfa840715374bd41c1b7edf37ef5 100644 (file)
@@ -44,10 +44,13 @@ public:
     CbDataList (C const &);
     ~CbDataList();
 
-    bool push_back_unique(C const &);
+    /// If element is already in the list, returns false.
+    /// Otherwise, adds the element to the end of the list and returns true.
+    /// Exists to avoid double iteration of find() and push() combo.
+    bool push_back_unique(C const &element);
     bool find(C const &)const;
     bool findAndTune(C const &);
-    /// iterates entire list to return the last element holder
+    /// Iterates the entire list to return the last element holder.
     CbDataList *tail();
     CbDataList *next;
     C element;
@@ -138,7 +141,7 @@ CbDataList<C>::push_back_unique(C const &toAdd)
             return false;
     }
 
-    last->next = new CbDataList<C> (toAdd);
+    last->next = new CbDataList<C>(toAdd);
     return true;
 }
 
@@ -151,7 +154,6 @@ CbDataList<C>::tail()
     return last;
 }
 
-
 template <class C>
 bool
 CbDataList<C>::find (C const &toFind) const