Remove redundant checks

g_set_error() handles error == NULL, so no need to check.
Patch by Ignacio Casal Quinteiro.

https://bugzilla.gnome.org/show_bug.cgi?id=640975
This commit is contained in:
Matthias Clasen 2011-09-17 20:27:16 -04:00
parent f18eab2ac7
commit 7b9571e4dd

View File

@ -763,13 +763,11 @@ g_convert_with_iconv (const gchar *str,
} }
break; break;
case EILSEQ: case EILSEQ:
if (error)
g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
_("Invalid byte sequence in conversion input")); _("Invalid byte sequence in conversion input"));
have_error = TRUE; have_error = TRUE;
break; break;
default: default:
if (error)
{ {
int errsv = errno; int errsv = errno;
@ -804,7 +802,6 @@ g_convert_with_iconv (const gchar *str,
{ {
if (!have_error) if (!have_error)
{ {
if (error)
g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, g_set_error_literal (error, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT,
_("Partial character sequence at end of input")); _("Partial character sequence at end of input"));
have_error = TRUE; have_error = TRUE;