aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-12-23 16:16:01 +0100
committerMax Kellermann <max@duempel.org>2010-12-23 16:23:20 +0100
commit5462f34ed037111d2d57638352b2f1a65a322579 (patch)
treed1acf3493d2d8edbbda9ae77a327d26ae249f3f9 /src/tokenizer.c
parent0958ed584431ac09e676dd51925e56142416e7c2 (diff)
string_util: add function strchug_fast()
Replace g_strchug() calls with a cheaper implementation.
Diffstat (limited to 'src/tokenizer.c')
-rw-r--r--src/tokenizer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tokenizer.c b/src/tokenizer.c
index 2b9e0507..358d804d 100644
--- a/src/tokenizer.c
+++ b/src/tokenizer.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "tokenizer.h"
+#include "string_util.h"
#include <stdbool.h>
#include <assert.h>
@@ -72,7 +73,7 @@ tokenizer_next_word(char **input_p, GError **error_r)
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
- input = g_strchug(input + 1);
+ input = strchug_fast(input + 1);
break;
}
@@ -126,7 +127,7 @@ tokenizer_next_unquoted(char **input_p, GError **error_r)
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
- input = g_strchug(input + 1);
+ input = strchug_fast(input + 1);
break;
}
@@ -205,7 +206,7 @@ tokenizer_next_string(char **input_p, GError **error_r)
/* finish the string and return it */
*dest = 0;
- *input_p = g_strchug(input);
+ *input_p = strchug_fast(input);
return word;
}