[epiphany] embed-utils: Invert the logic of condition in ephy_embed_utils_address_has_web_scheme
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] embed-utils: Invert the logic of condition in ephy_embed_utils_address_has_web_scheme
- Date: Mon, 3 Mar 2014 13:35:10 +0000 (UTC)
commit 8f441f2aa17bb2597753a44bb6d20cba24f71308
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Mon Feb 24 14:08:03 2014 +0100
embed-utils: Invert the logic of condition in ephy_embed_utils_address_has_web_scheme
So that we don't need to do all the string comparisons always.
https://bugzilla.gnome.org/show_bug.cgi?id=725081
embed/ephy-embed-utils.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 80a28bc..6eb5c4a 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -84,15 +84,15 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
if (colonpos < 0)
return FALSE;
- has_web_scheme = !(g_ascii_strncasecmp (address, "http", colonpos) &&
- g_ascii_strncasecmp (address, "https", colonpos) &&
- g_ascii_strncasecmp (address, "ftp", colonpos) &&
- g_ascii_strncasecmp (address, "file", colonpos) &&
- g_ascii_strncasecmp (address, "javascript", colonpos) &&
- g_ascii_strncasecmp (address, "data", colonpos) &&
- g_ascii_strncasecmp (address, "about", colonpos) &&
- g_ascii_strncasecmp (address, "ephy-about", colonpos) &&
- g_ascii_strncasecmp (address, "gopher", colonpos));
+ has_web_scheme = (!g_ascii_strncasecmp (address, "http", colonpos) ||
+ !g_ascii_strncasecmp (address, "https", colonpos) ||
+ !g_ascii_strncasecmp (address, "about", colonpos) ||
+ !g_ascii_strncasecmp (address, "ephy-about", colonpos) ||
+ !g_ascii_strncasecmp (address, "ftp", colonpos) ||
+ !g_ascii_strncasecmp (address, "file", colonpos) ||
+ !g_ascii_strncasecmp (address, "javascript", colonpos) ||
+ !g_ascii_strncasecmp (address, "data", colonpos) ||
+ !g_ascii_strncasecmp (address, "gopher", colonpos));
return has_web_scheme;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]