[ox] Fix for GCC pedantry around potential null ptrs that will never happen
This commit is contained in:
parent
db3e9c5d93
commit
94e3ed217a
3
deps/ox/src/ox/mc/write.hpp
vendored
3
deps/ox/src/ox/mc/write.hpp
vendored
@ -365,7 +365,8 @@ constexpr Error MetalClawWriter::field(const char*, const HashMap<String, T> *va
|
||||
auto wkey = ox_malloca(keyLen + 1, char, 0);
|
||||
memcpy(wkey, key.c_str(), keyLen + 1);
|
||||
oxReturnError(handler.fieldCString("", wkey.get(), keyLen));
|
||||
oxReturnError(handler.field("", val->at(key).value));
|
||||
oxRequireM(value, val->at(key));
|
||||
oxReturnError(handler.field("", value));
|
||||
}
|
||||
m_buffIt += writer.m_buffIt;
|
||||
fieldSet = true;
|
||||
|
5
deps/ox/src/ox/oc/write.hpp
vendored
5
deps/ox/src/ox/oc/write.hpp
vendored
@ -122,7 +122,10 @@ class OrganicClawWriter {
|
||||
ModelHandlerInterface handler{&w};
|
||||
for (std::size_t i = 0; i < keys.size(); ++i) {
|
||||
const auto k = keys[i].c_str();
|
||||
oxReturnError(handler.field(k, val->at(k).value));
|
||||
if (k) [[likely]] {
|
||||
oxRequireM(value, val->at(k));
|
||||
oxReturnError(handler.field(k, value));
|
||||
}
|
||||
}
|
||||
value(key) = w.m_json;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user