mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-07 09:48:04 +02:00
lcUTF8: remove two unneeded ifs and two elses that are never reached
When there is a break at the end of the while loop, it means that the loop will finish the first time that _XlcGetCharSetWithSide() returns a non-NULL result, which means that the first '(last_charset == NULL)' will always be true and the else part is redundant. Fixes issue #46. Reported-by: Bhavi Dhingra Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
parent
033f37d507
commit
f15d2a01f7
1 changed files with 12 additions and 24 deletions
|
|
@ -742,20 +742,14 @@ utf8tocs1(
|
|||
continue;
|
||||
}
|
||||
|
||||
last_charset = _XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
|
||||
|
||||
if (last_charset == NULL) {
|
||||
last_charset =
|
||||
_XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
|
||||
if (last_charset == NULL) {
|
||||
src += consumed;
|
||||
unconv_num++;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name
|
||||
&& (last_charset->side == XlcGLGR
|
||||
|| last_charset->side == chosen_side)))
|
||||
break;
|
||||
src += consumed;
|
||||
unconv_num++;
|
||||
continue;
|
||||
}
|
||||
|
||||
src += consumed;
|
||||
dst += count;
|
||||
break;
|
||||
|
|
@ -1615,20 +1609,14 @@ wcstocs1(
|
|||
continue;
|
||||
}
|
||||
|
||||
last_charset = _XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
|
||||
|
||||
if (last_charset == NULL) {
|
||||
last_charset =
|
||||
_XlcGetCharSetWithSide(chosen_charset->name, chosen_side);
|
||||
if (last_charset == NULL) {
|
||||
src++;
|
||||
unconv_num++;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!(last_charset->xrm_encoding_name == chosen_charset->xrm_name
|
||||
&& (last_charset->side == XlcGLGR
|
||||
|| last_charset->side == chosen_side)))
|
||||
break;
|
||||
src++;
|
||||
unconv_num++;
|
||||
continue;
|
||||
}
|
||||
|
||||
src++;
|
||||
dst += count;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue