[gtksourceview] Search: small fix in the implementation overview
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Search: small fix in the implementation overview
- Date: Sun, 6 Oct 2013 15:48:41 +0000 (UTC)
commit 4a17f863c5745a07dc03f4de97fe5f6dbfd11312
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Oct 6 17:44:47 2013 +0200
Search: small fix in the implementation overview
The docs/text_widget_internals.txt document in gtk+ says:
This is complicated somewhat because we keep information about
the tag toggles in the btree, allowing us to locate tagged
regions or add/remove tags in O(log N) instead of O(N) time.
gtksourceview/gtksourcesearchcontext.c | 3 ++-
tests/test-search-performances.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 89af1da..a978a28 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -104,7 +104,8 @@
* through the occurrences. But we can do better than that!
* forward_to_tag_toggle() and backward_to_tag_toggle() are far more efficient:
* once the buffer has been scanned, going to the previous or the next
- * occurrence is done in O(1). We must just pay attention to contiguous matches.
+ * occurrence is done in O(log n), with n the length of the buffer. We must just
+ * pay attention to contiguous matches.
*
* While the user is typing the text in the search entry, the buffer is scanned
* to count the number of occurrences. And when the user wants to do an
diff --git a/tests/test-search-performances.c b/tests/test-search-performances.c
index 1b7c622..c4a2588 100644
--- a/tests/test-search-performances.c
+++ b/tests/test-search-performances.c
@@ -29,7 +29,7 @@
* - regex search.
*
* For the "smart" search, only the first search is measured. Later searches
- * are really fast (going to the previous/next occurrence is done in O(1)).
+ * are really fast (going to the previous/next occurrence is done in O(log n)).
* Different search flags are also tested. We can see a big difference between
* the case sensitive search and case insensitive.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]