]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.36
authorfred <fred>
Sun, 24 Mar 2002 20:02:00 +0000 (20:02 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:02:00 +0000 (20:02 +0000)
flower/NEWS
flower/include/assoc.hh

index f9e06e05526400da14938e7ef67944593f8e0fac..5610f02a099e3a45e0740a031a5dc7cce32edcae 100644 (file)
@@ -1,3 +1,8 @@
+pl 32
+       - Assoc::clear
+       - bf: Assoc[PreviouslyUsedAndDeletedKey] = foo
+
+       
 pl 31
        - removed String::bool () [Sigh], String::operator char const * 
 pl 30
index 86d28b0fd3081cc8cec96b71e1e7b65d1c9962cb..f4558545a1e972d0a0bbab3bd4c176aa8834360c 100644 (file)
@@ -36,7 +36,7 @@ struct Assoc {
   int find_creat (K key) {
     int free = -1;
     for (int i = 0; i < arr.size(); i++) {
-      if (key == arr[i].key) {         
+      if (!arr[i].free && key == arr[i].key) {         
        return i;
       } else if (arr[i].free) {
        free = i;
@@ -80,6 +80,11 @@ public:
     assert (elt_b (key));
     return arr[find (key)].val;
   }
+  void clear () 
+  {
+    for (int i=0 ;  i < arr.size (); i++)
+      arr[i].free = true;
+  }
 };
 
 #endif