mirror of
https://github.com/esphome/esphome.git
synced 2026-09-28 15:30:21 +00:00
[core] Pass the copy flag to JsonString explicitly in the StringRef conversion (#19709)
This commit is contained in:
@@ -279,7 +279,9 @@ inline void convertToJson(const StringRef &src, JsonVariant dst) {
|
||||
dst.set("");
|
||||
return;
|
||||
}
|
||||
dst.set(JsonString(src.c_str(), src.size()));
|
||||
// The explicit isStatic is load bearing: without it clang-tidy reads size() as the bool of the two argument
|
||||
// constructor and asks for empty() instead
|
||||
dst.set(JsonString(src.c_str(), src.size(), /* isStatic= */ false));
|
||||
}
|
||||
#endif // USE_JSON
|
||||
|
||||
|
||||
Reference in New Issue
Block a user