aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/symbols.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-23 19:15:17 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-23 19:15:17 +0100
commitfd4b89e797c1efc73304fa4da073fb31f55527f1 (patch)
tree71979801338b2e5a6e25fa2f300c5edd5ba70551 /src/symbols.cpp
parent1b636e3cc7326e9139ff107b2818703181c6e7f7 (diff)
downloadsciteco-fd4b89e797c1efc73304fa4da073fb31f55527f1.tar.gz
fixed symbol lists: sort order must correspond with search order (determined by comparision function)
* lists were sorted lexicographically (like strcmp()), but searched caseless (like strcasecmp()) * lists are now sorted with strcasecmp()-like comparision * caselessness is thus a property of the SymbolList * use new language features in symbols-extract.tes
Diffstat (limited to 'src/symbols.cpp')
-rw-r--r--src/symbols.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/symbols.cpp b/src/symbols.cpp
index 5b0de92..60abf57 100644
--- a/src/symbols.cpp
+++ b/src/symbols.cpp
@@ -39,17 +39,14 @@ namespace Symbols {
* binary search.
*/
gint
-SymbolList::lookup(const gchar *name, const gchar *prefix, bool case_sensitive)
+SymbolList::lookup(const gchar *name, const gchar *prefix)
{
- int (*cmp_fnc)(const char *, const char *, size_t);
gint prefix_skip = strlen(prefix);
gint name_len = strlen(name);
gint left = 0;
gint right = size - 1;
- cmp_fnc = case_sensitive ? strncmp : g_ascii_strncasecmp;
-
if (!cmp_fnc(name, prefix, prefix_skip))
prefix_skip = 0;