mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils: simplified string list lookup
This commit is contained in:
@ -52,15 +52,13 @@ obs_bounds_type getBoundsTypeFromName(QString name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Utils::StringInStringList(char** strings, const char* string) {
|
bool Utils::StringInStringList(char** strings, const char* string) {
|
||||||
|
if (!strings) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
char* value = nullptr;
|
while (strings[index] != NULL) {
|
||||||
|
char* value = strings[index];
|
||||||
while (1) {
|
|
||||||
value = strings[index];
|
|
||||||
|
|
||||||
if (value == nullptr) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(value, string) == 0) {
|
if (strcmp(value, string) == 0) {
|
||||||
return true;
|
return true;
|
||||||
@ -68,6 +66,7 @@ bool Utils::StringInStringList(char** strings, const char* string) {
|
|||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user