mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-06-30 08:33:32 +00:00
libcaption: Optimize branch conditons
The optimization silences the warning about type limits on platforms with `char` type as `unsigned char`. The original condition is semantically identical to the optimized one because the signed-to-unsigned cast is well-defined in C standard.
This commit is contained in:
parent
14db1489e0
commit
c96a2a64fc
2
deps/libcaption/src/utf8.c
vendored
2
deps/libcaption/src/utf8.c
vendored
|
@ -51,7 +51,7 @@ size_t utf8_char_length(const utf8_char_t* c)
|
|||
int utf8_char_whitespace(const utf8_char_t* c)
|
||||
{
|
||||
// 0x7F is DEL
|
||||
if (!c || (c[0] >= 0 && c[0] <= ' ') || c[0] == 0x7F) {
|
||||
if (!c || (unsigned char)c[0] <= ' ' || c[0] == 0x7F) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue