simplify array cast a little

This commit is contained in:
Green Sky 2024-02-17 23:04:34 +01:00
parent 527a7c63f6
commit fb885b5c21
No known key found for this signature in database

View File

@ -36,7 +36,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
return true; return true;
} }
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]); const std::vector<uint8_t> id = j.is_binary()?j:j["bytes"];
// TODO: id lookup table, this is very inefficent // TODO: id lookup table, this is very inefficent
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) { for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {
@ -79,7 +79,7 @@ bool MessageSerializerCallbacks::component_emplace_or_replace_json<Message::Comp
return true; return true;
} }
const auto id = static_cast<std::vector<uint8_t>>(j.is_binary()?j:j["bytes"]); const std::vector<uint8_t> id = j.is_binary()?j:j["bytes"];
// TODO: id lookup table, this is very inefficent // TODO: id lookup table, this is very inefficent
for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) { for (const auto& [c_it, id_it] : msc.cr.view<Contact::Components::ID>().each()) {