refactor: use StringToLower from zm_utils.h

Replace inline ASCII lowercase conversion with existing StringToLower
utility function for consistency with the rest of the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ben Dailey
2026-01-15 14:44:07 -05:00
parent 1159347636
commit ba4307cb0b

View File

@@ -1090,12 +1090,8 @@ bool ONVIF::interpret_alarm_value(const std::string &value) {
return false; // Empty value = no alarm
}
// Convert to lowercase once for case-insensitive comparison (ASCII-only)
std::string lower_value;
lower_value.reserve(value.size());
for (char c : value) {
lower_value += (c >= 'A' && c <= 'Z') ? static_cast<char>(c + 32) : c;
}
// Convert to lowercase once for case-insensitive comparison
std::string lower_value = StringToLower(value);
// Check for explicit false/inactive values
if (lower_value == "false" ||