[epiphany] uri-tester: don't use regular expressions for trivial checks
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] uri-tester: don't use regular expressions for trivial checks
- Date: Wed, 21 May 2014 10:52:50 +0000 (UTC)
commit 9cf0065c4526bec2c111315e8ff5a2d930a685e8
Author: Marco Barisione <marco barisione collabora co uk>
Date: Wed May 14 08:25:27 2014 +0100
uri-tester: don't use regular expressions for trivial checks
https://bugzilla.gnome.org/show_bug.cgi?id=730129
embed/uri-tester.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/embed/uri-tester.c b/embed/uri-tester.c
index ab701c4..5958262 100644
--- a/embed/uri-tester.c
+++ b/embed/uri-tester.c
@@ -493,7 +493,7 @@ uri_tester_compile_regexp (UriTester *tester,
for (pos = len - SIGNATURE_SIZE; pos >= 0; pos--) {
sig = g_strndup (patt + pos, SIGNATURE_SIZE);
- if (!g_regex_match_simple ("[\\*]", sig, G_REGEX_UNGREEDY, G_REGEX_MATCH_NOTEMPTY) &&
+ if (!strchr (sig, '*') &&
!g_hash_table_lookup (tester->priv->keys, sig))
{
LOG ("sig: %s %s", sig, patt);
@@ -503,7 +503,7 @@ uri_tester_compile_regexp (UriTester *tester,
}
else
{
- if (g_regex_match_simple ("^\\*", sig, G_REGEX_UNGREEDY, G_REGEX_MATCH_NOTEMPTY) &&
+ if (sig[0] == '*' &&
!g_hash_table_lookup (tester->priv->pattern, patt))
{
LOG ("patt2: %s %s", sig, patt);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]