aboutsummaryrefslogtreecommitdiffhomepage
path: root/symbols.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-24 19:54:20 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-24 19:54:20 +0100
commit2add69b7f08f19ae2687276ebafcf6989915aa69 (patch)
treebe0e81f4c8477967ed3e448c93519fd9f0afe8ef /symbols.cpp
parenta532338ca642ed386270047aefc56ed11ef120d3 (diff)
downloadsciteco-2add69b7f08f19ae2687276ebafcf6989915aa69.tar.gz
cache GLists corresponding to symbol lists
Diffstat (limited to 'symbols.cpp')
-rw-r--r--symbols.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/symbols.cpp b/symbols.cpp
index 8e81354..c05d153 100644
--- a/symbols.cpp
+++ b/symbols.cpp
@@ -51,10 +51,10 @@ SymbolList::lookup(const gchar *name, const gchar *prefix, bool case_sensitive)
GList *
SymbolList::get_glist(void)
{
- GList *list = NULL;
-
- while (size--)
- list = g_list_prepend(list, (gchar *)entries[size].name);
+ if (!list) {
+ for (gint i = size; i; i--)
+ list = g_list_prepend(list, (gchar *)entries[i-1].name);
+ }
return list;
}