mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-04-08 11:37:03 +00:00
string_view speed-ups in the JSON related code
This commit is contained in:
parent
ef0f8a5654
commit
c92c8d768c
@ -150,9 +150,9 @@ bool checker_t::checkState(test_t test) {
|
||||
const auto actual_value = std::get<1>(actual);
|
||||
check("Cycle value", expected_value, actual_value);
|
||||
|
||||
const auto expected_action = std::string_view(*expected_data);
|
||||
const auto& actual_action = std::get<2>(actual);
|
||||
check("Cycle action", expected_action, std::string_view(actual_action));
|
||||
const auto expected_action = (*expected_data).get_string();
|
||||
const auto actual_action = std::get<2>(actual);
|
||||
check("Cycle action", expected_action.value_unsafe(), actual_action);
|
||||
}
|
||||
if (!m_messages.empty())
|
||||
return false;
|
||||
|
@ -11,5 +11,5 @@ public:
|
||||
cycle_t(const simdjson::dom::array input) noexcept
|
||||
: byte_t(input) {}
|
||||
|
||||
[[nodiscard]] auto action() const noexcept { return std::string(std::string_view(at(2))); }
|
||||
[[nodiscard]] auto action() const noexcept { return at(2).get_string(); }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user