lint cleanup: eliminate "redundant" errors

This removes some pointless parentheses but the primary focus is removing
redundancies like unnecessary "else" clauses.
This commit is contained in:
Kurtis Rader
2016-05-04 15:19:47 -07:00
parent 527e5f52ba
commit 79f342b954
34 changed files with 456 additions and 531 deletions

View File

@@ -194,20 +194,15 @@ char *wcs2str(const wchar_t *in) {
if (result) {
// It converted into the local buffer, so copy it.
result = strdup(result);
if (!result) {
DIE_MEM();
}
if (!result) DIE_MEM();
}
return result;
} else {
// Here we probably allocate a buffer probably much larger than necessary.
char *out = (char *)malloc(MAX_UTF8_BYTES * wcslen(in) + 1);
if (!out) {
DIE_MEM();
}
return wcs2str_internal(in, out);
}
// Here we probably allocate a buffer probably much larger than necessary.
char *out = (char *)malloc(MAX_UTF8_BYTES * wcslen(in) + 1);
if (!out) DIE_MEM();
return wcs2str_internal(in, out);
}
char *wcs2str(const wcstring &in) { return wcs2str(in.c_str()); }
@@ -411,10 +406,8 @@ wcstring wsetlocale(int category, const wchar_t *locale) {
// U+23CE is the "return" character
omitted_newline_char = (wcwidth(L'\x23CE') > 0) ? L'\x23CE' : L'~';
if (!res)
return wcstring();
else
return format_string(L"%s", res);
if (!res) return wcstring();
return format_string(L"%s", res);
}
bool contains_internal(const wchar_t *a, int vararg_handle, ...) {