[devhelp] search: Improve performance when filtering by book
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] search: Improve performance when filtering by book
- Date: Tue, 14 Dec 2010 23:42:46 +0000 (UTC)
commit 298a9e26105b24b8ac018b9efd230614c25670e9
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed Dec 15 00:17:06 2010 +0100
search: Improve performance when filtering by book
src/dh-keyword-model.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/dh-keyword-model.c b/src/dh-keyword-model.c
index 3ff7b7a..37bd24f 100644
--- a/src/dh-keyword-model.c
+++ b/src/dh-keyword-model.c
@@ -370,6 +370,11 @@ keyword_model_search (DhKeywordModel *model,
book = DH_BOOK (b->data);
+ if (book_id &&
+ g_strcmp0 (book_id, dh_book_get_name (book)) != 0) {
+ continue;
+ }
+
for (l = dh_book_get_keywords (book);
l && hits < MAX_HITS;
l = g_list_next (l)) {
@@ -380,12 +385,6 @@ keyword_model_search (DhKeywordModel *model,
link = l->data;
found = FALSE;
- if (book_id &&
- dh_link_get_book_id (link) &&
- strcmp (dh_link_get_book_id (link), book_id) != 0) {
- continue;
- }
-
if (page_id &&
(dh_link_get_link_type (link) != DH_LINK_TYPE_PAGE &&
!g_str_has_prefix (dh_link_get_file_name (link), page_filename_prefix))) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]