summaryrefslogtreecommitdiff
path: root/src/gui/gui-completion.h
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-09-01 07:38:27 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-09-01 11:51:04 +0200
commitf0aa0a21b213a23fdd9f0ad4033f620824197c1b (patch)
tree0f605f298e27ff81d97081021f507a1d2f1bfce2 /src/gui/gui-completion.h
parentdda1a66fd738152e41fc2ab21e1d6835e2c43aab (diff)
downloadweechat-f0aa0a21b213a23fdd9f0ad4033f620824197c1b.zip
core: optimize completion by using arraylists
With arraylist (vs weelist), the completion is about 50x faster. It is visible on "/help [+tab]".
Diffstat (limited to 'src/gui/gui-completion.h')
-rw-r--r--src/gui/gui-completion.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/gui-completion.h b/src/gui/gui-completion.h
index 7192779de..7c1368937 100644
--- a/src/gui/gui-completion.h
+++ b/src/gui/gui-completion.h
@@ -25,12 +25,12 @@
#define GUI_COMPLETION_COMMAND_ARG 2
#define GUI_COMPLETION_AUTO 3
-struct t_gui_completion_partial
+struct t_gui_completion_word
{
- char *word; /* (partial) word matching completion */
+ char *word; /* word matching completion */
+ char nick_completion; /* 1 if it is completion of a nick */
int count; /* number of matching items with this word */
- struct t_gui_completion_partial *prev_item;
- struct t_gui_completion_partial *next_item;
+ /* (for partial completion) */
};
struct t_gui_completion
@@ -49,7 +49,7 @@ struct t_gui_completion
int force_partial_completion; /* force partial completion? */
/* for command argument completion */
- struct t_weelist *completion_list; /* data list for completion */
+ struct t_arraylist *list; /* data list for completion */
/* completion found */
char *word_found; /* word found (to replace base word) */
@@ -59,8 +59,7 @@ struct t_gui_completion
int diff_length; /* length difference (<= diff_size) */
/* partial completion */
- struct t_gui_completion_partial *partial_completion_list;
- struct t_gui_completion_partial *last_partial_completion;
+ struct t_arraylist *partial_list;
};
/* completion variables */