2008/8/13 Kinkie <[EMAIL PROTECTED]>:
> Hi all,
>     this patch is an attempt at streamlining the wordlist implementation in
> 3.HEAD, by:
> - OO-izing it [1]
> - providing an unit-test for it
> - giving it a couple of convenience functions
> - documenting it
>
> It's still a work-in-progress, but in the end a wordlist would probably be
> better implemented by using a set of Strings anyways.
> It's however a step forward already, since it gives wordlist callers better
> c++ semantics than the current implementation in HEAD.
>
> The patch has been compile-tested, unit-tested, test-suite'd and run-tested.

Um, so you've not gotten rid of the ugly previous wordlist behaviour?

Why are you doing stuff like this?

+    *W += *regex_dump;
+    delete regex_dump;

Why not W->add(regex_dump)

?

Whats this:
const char *
+wordlist::add(const char *word)
+{
+    wordlist *cur=this;
+
+    if (key==NULL) { //special case empty wordlist
+        key = xstrdup(word);
+        return key;
+    }
+
+    while (cur->next != NULL)
+        cur = cur->next;
+
+    cur->next = new wordlist(word);
+
+    return word;
+}

Reply via email to