mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-16 19:32:32 +00:00
Remove fancy iterator shenigans from simdjson usage.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
0ef06ebbb2
commit
5d66d1aac3
@ -14,9 +14,8 @@ byte_t::byte_t(simdjson::dom::element input) noexcept
|
||||
: byte_t(input.get_array()) {}
|
||||
|
||||
byte_t::byte_t(simdjson::dom::array input) noexcept
|
||||
: m_iterator(input.begin()),
|
||||
m_address((uint16_t)(uint64_t)*m_iterator),
|
||||
m_value((uint8_t)(uint64_t)*++m_iterator) {
|
||||
: m_address((uint16_t)(uint64_t)input.at(0)),
|
||||
m_value((uint8_t)(uint64_t)input.at(1)) {
|
||||
assert(input.size() == 2);
|
||||
}
|
||||
|
||||
|
@ -24,9 +24,6 @@
|
||||
|
||||
class byte_t final {
|
||||
private:
|
||||
#ifdef USE_SIMDJSON_JSON
|
||||
simdjson::dom::array::iterator m_iterator;
|
||||
#endif
|
||||
uint16_t m_address = 0xffff;
|
||||
uint8_t m_value = 0xff;
|
||||
|
||||
|
@ -31,10 +31,9 @@ cycle_t::cycle_t(simdjson::dom::element input) noexcept
|
||||
: cycle_t(input.get_array()) {}
|
||||
|
||||
cycle_t::cycle_t(simdjson::dom::array input) noexcept
|
||||
: m_iterator(input.begin()),
|
||||
m_address((uint16_t)(uint64_t)*m_iterator),
|
||||
m_value((uint8_t)(uint64_t)*++m_iterator),
|
||||
m_action(to_action((std::string)*++m_iterator)) {
|
||||
: m_address((uint16_t)(uint64_t)input.at(0)),
|
||||
m_value((uint8_t)(uint64_t)input.at(1)),
|
||||
m_action(to_action((std::string)input.at(2))) {
|
||||
assert(input.size() == 3);
|
||||
}
|
||||
|
||||
|
@ -28,9 +28,6 @@ public:
|
||||
enum class action_t { read, write, unknown };
|
||||
|
||||
private:
|
||||
#ifdef USE_SIMDJSON_JSON
|
||||
simdjson::dom::array::iterator m_iterator;
|
||||
#endif
|
||||
uint16_t m_address = 0xffff;
|
||||
uint8_t m_value = 0xff;
|
||||
action_t m_action = action_t::unknown;
|
||||
|
Loading…
x
Reference in New Issue
Block a user