diff options
| author | Simon Tatham <anakin@pobox.com> | 2001-12-14 12:44:14 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2001-12-14 12:44:14 +0000 |
| commit | 22b1d999006ac7b67d675305087677c589f03cd6 (patch) | |
| tree | 1664e3b07694656820d4b9835933b1044cf7c619 /main.c | |
| parent | e06e29ae22c80de7f1b12fa5b81350a21a3ad3b3 (diff) | |
| download | halibut-22b1d999006ac7b67d675305087677c589f03cd6.zip halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.gz halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.bz2 halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.xz | |
Keywords are now collected using a B-tree rather than an array with
heapsort. This makes the code much simpler for a start, but the main
reason is so that we can spot duplicate keywords as we go along
rather than having to wait until the end of input processing.
[originally from svn r1489]
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -259,11 +259,12 @@ static void dbg_prtkws(keywordlist *kws) { */ int i; + keyword *kw; - for (i = 0; i < kws->nkeywords; i++) { + for (i = 0; (kw = index234(kws->keys, i)) != NULL; i++) { wchar_t *wp; printf("keyword "); - wp = kws->keys[i]->key; + wp = kw->key; while (*wp) { putchar('\"'); for (; *wp; wp++) @@ -273,7 +274,7 @@ static void dbg_prtkws(keywordlist *kws) { printf(", "); } printf(" {\n"); - dbg_prtwordlist(1, kws->keys[i]->text); + dbg_prtwordlist(1, kw->text); printf("}\n"); } } |