aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mansearch.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-06 03:02:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-06 03:02:46 +0000
commitc2dd68816c9e05ae3f31a96307caa577ff4db3dd (patch)
treeecd4eaa940f486430e1df4191069df42070c6a5b /mansearch.c
parent8bb474af93ace25f45da1da08a3c358cf9684b6d (diff)
downloadmandoc-c2dd68816c9e05ae3f31a96307caa577ff4db3dd.tar.gz
mandoc-c2dd68816c9e05ae3f31a96307caa577ff4db3dd.tar.zst
mandoc-c2dd68816c9e05ae3f31a96307caa577ff4db3dd.zip
Drop Nd from the mpages table, it is still in the keys table.
This shrinks the database in standard mode by 3%, in -Q mode by 9%, without loss of functionality.
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mansearch.c b/mansearch.c
index 20b5a536..71f383e2 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.17 2014/01/05 04:13:52 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.18 2014/01/06 03:02:46 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -70,7 +70,6 @@ struct expr {
struct match {
uint64_t id; /* identifier in database */
- char *desc; /* description of manpage */
int form; /* 0 == catpage */
};
@@ -279,7 +278,7 @@ mansearch(const struct mansearch *search,
* distribution of buckets in the table.
*/
while (SQLITE_ROW == (c = sqlite3_step(s))) {
- id = sqlite3_column_int64(s, 2);
+ id = sqlite3_column_int64(s, 1);
idx = ohash_lookup_memory
(&htab, (char *)&id,
sizeof(uint64_t), (uint32_t)id);
@@ -289,9 +288,7 @@ mansearch(const struct mansearch *search,
mp = mandoc_calloc(1, sizeof(struct match));
mp->id = id;
- mp->desc = mandoc_strdup
- ((char *)sqlite3_column_text(s, 0));
- mp->form = sqlite3_column_int(s, 1);
+ mp->form = sqlite3_column_int(s, 0);
ohash_insert(&htab, idx, mp);
}
@@ -321,7 +318,6 @@ mansearch(const struct mansearch *search,
(*res, maxres * sizeof(struct manpage));
}
mpage = *res + cur;
- mpage->desc = mp->desc;
mpage->form = mp->form;
buildnames(mpage, db, s, mp->id, paths->paths[i]);
mpage->output = outbit ?