From f006a5e3993a934cb6df1271edca49e211202033 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 6 Dec 1997 00:55:23 +0000 Subject: [PATCH] lilypond-0.1.36 --- flower/NEWS | 5 +++++ flower/include/assoc.hh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/flower/NEWS b/flower/NEWS index f9e06e0552..5610f02a09 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,3 +1,8 @@ +pl 32 + - Assoc::clear + - bf: Assoc[PreviouslyUsedAndDeletedKey] = foo + + pl 31 - removed String::bool () [Sigh], String::operator char const * pl 30 diff --git a/flower/include/assoc.hh b/flower/include/assoc.hh index 86d28b0fd3..f4558545a1 100644 --- a/flower/include/assoc.hh +++ b/flower/include/assoc.hh @@ -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 -- 2.11.4.GIT