Replace String comparisons with "", String() to is_empty()
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
This commit is contained in:
@@ -1565,7 +1565,7 @@ String DisplayServerWindows::keyboard_get_layout_name(int p_index) const {
|
||||
GetKeyboardLayoutList(layout_count, layouts);
|
||||
|
||||
String ret = _get_full_layout_name_from_registry(layouts[p_index]); // Try reading full name from Windows registry, fallback to locale name if failed (e.g. on Wine).
|
||||
if (ret == String()) {
|
||||
if (ret.is_empty()) {
|
||||
WCHAR buf[LOCALE_NAME_MAX_LENGTH];
|
||||
memset(buf, 0, LOCALE_NAME_MAX_LENGTH * sizeof(WCHAR));
|
||||
LCIDToLocaleName(MAKELCID(LOWORD(layouts[p_index]), SORT_DEFAULT), buf, LOCALE_NAME_MAX_LENGTH, 0);
|
||||
|
||||
Reference in New Issue
Block a user