Signed-off-by: Francois Gouget fgouget@free.fr ---
It seems wasteful to compute the length of the string when all we care about is the first character. Plus the 'if (*str)' pattern is pretty common and used extensively in Wine already.
Note that this does not change handling of NULL pointers since strlen() does not check for them.
dlls/winebus.sys/bus_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index dabda6a2705..64b245e630d 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -1084,7 +1084,7 @@ static int parse_uevent_info(const char *uevent, DWORD *vendor_id, else if (strcmp(key, "HID_UNIQ") == 0) { /* The caller has to free the serial number */ - if (strlen(value)) + if (*value) { *serial_number = (WCHAR*)strdupAtoW(value); found_serial = 1;