Commit b079334c authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

gst: Simplify some boolean expressions

(!x || (x && y)) is the same as (!x || y)

https://bugzilla.gnome.org/show_bug.cgi?id=796847
parent 2aa9ad9c
......@@ -279,7 +279,7 @@ name_is_valid (const gchar * name, GstPadPresence presence)
underscore = strchr (str, '_');
str = strchr (str + 1, '%');
if (str && (!underscore || (underscore && str < underscore))) {
if (str && (!underscore || str < underscore)) {
g_warning
("invalid name template %s: each of conversion specifications "
"must be separated by an underscore", name);
......
......@@ -193,7 +193,7 @@ _gst_parse_escape (const gchar * str)
in_quotes = FALSE;
while (*str) {
if (*str == '"' && (!in_quotes || (in_quotes && *(str - 1) != '\\')))
if (*str == '"' && (!in_quotes || *(str - 1) != '\\'))
in_quotes = !in_quotes;
if (*str == ' ' && !in_quotes)
......
......@@ -89,8 +89,7 @@ gst_parse_unescape (gchar *str)
/* make sure we don't read beyond the end of the string */
if (*walk == '\0')
break;
} else if (*walk == '"' && (!in_quotes || (in_quotes
&& (*(walk - 1) != '\\')))) {
} else if (*walk == '"' && (!in_quotes || *(walk - 1) != '\\')) {
/* don't unescape inside quotes and don't switch
* state with escaped quoted inside quotes */
in_quotes = !in_quotes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment