mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
gst: Simplify some boolean expressions
(!x || (x && y)) is the same as (!x || y) https://bugzilla.gnome.org/show_bug.cgi?id=796847
This commit is contained in:
parent
2aa9ad9c62
commit
b079334c1c
3 changed files with 3 additions and 4 deletions
|
@ -279,7 +279,7 @@ name_is_valid (const gchar * name, GstPadPresence presence)
|
||||||
underscore = strchr (str, '_');
|
underscore = strchr (str, '_');
|
||||||
str = strchr (str + 1, '%');
|
str = strchr (str + 1, '%');
|
||||||
|
|
||||||
if (str && (!underscore || (underscore && str < underscore))) {
|
if (str && (!underscore || str < underscore)) {
|
||||||
g_warning
|
g_warning
|
||||||
("invalid name template %s: each of conversion specifications "
|
("invalid name template %s: each of conversion specifications "
|
||||||
"must be separated by an underscore", name);
|
"must be separated by an underscore", name);
|
||||||
|
|
|
@ -193,7 +193,7 @@ _gst_parse_escape (const gchar * str)
|
||||||
in_quotes = FALSE;
|
in_quotes = FALSE;
|
||||||
|
|
||||||
while (*str) {
|
while (*str) {
|
||||||
if (*str == '"' && (!in_quotes || (in_quotes && *(str - 1) != '\\')))
|
if (*str == '"' && (!in_quotes || *(str - 1) != '\\'))
|
||||||
in_quotes = !in_quotes;
|
in_quotes = !in_quotes;
|
||||||
|
|
||||||
if (*str == ' ' && !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 */
|
/* make sure we don't read beyond the end of the string */
|
||||||
if (*walk == '\0')
|
if (*walk == '\0')
|
||||||
break;
|
break;
|
||||||
} else if (*walk == '"' && (!in_quotes || (in_quotes
|
} else if (*walk == '"' && (!in_quotes || *(walk - 1) != '\\')) {
|
||||||
&& (*(walk - 1) != '\\')))) {
|
|
||||||
/* don't unescape inside quotes and don't switch
|
/* don't unescape inside quotes and don't switch
|
||||||
* state with escaped quoted inside quotes */
|
* state with escaped quoted inside quotes */
|
||||||
in_quotes = !in_quotes;
|
in_quotes = !in_quotes;
|
||||||
|
|
Loading…
Reference in a new issue