Ref counting
[iotcloud.git] / version2 / src / C / vector.h
index 4c4a7e5cb1a2cd3807b5fd757172cbc01a8152ef..5ca954be06926f5eecc61b4fef1a0e147f5b8baa 100644 (file)
@@ -30,16 +30,17 @@ public:
                fldsize--;
        }
 
-       void remove(type t) {
+       bool remove(type t) {
                for (uint i = 0; i < fldsize; i++) {
                        if (array[i] == t) {
                                for (i++; i < fldsize; i++) {
                                        array[i - 1] = array[i];
                                }
                                fldsize--;
-                               break;
+                               return true;
                        }
                }
+               return false;
        }
 
        void removeIndex(uint i) {
@@ -73,7 +74,7 @@ public:
 
        void removeAll(Vector<type> *v) {
                uint vsize = v->size();
-               for(uint i = 0; i < vsize; i++)
+               for (uint i = 0; i < vsize; i++)
                        remove(v->get(i));
        }