From 55c7afd25f695ca0f1b356151bec3a04fb2bfee3 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 28 Feb 2026 12:45:17 +0000 Subject: [PATCH] Simplify string access --- M6502/HarteTest_6502/array_t.h | 1 + M6502/HarteTest_6502/cycle_t.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/M6502/HarteTest_6502/array_t.h b/M6502/HarteTest_6502/array_t.h index 72a4a4d..ce2c49f 100644 --- a/M6502/HarteTest_6502/array_t.h +++ b/M6502/HarteTest_6502/array_t.h @@ -21,4 +21,5 @@ public: [[nodiscard]] auto operator[](size_t idx) const noexcept { return at(idx); } [[nodiscard]] auto integer_at(size_t idx) const noexcept { return int64_t(at(idx)); } + [[nodiscard]] auto string_at(size_t idx) const noexcept { return at(idx).get_string(); } }; diff --git a/M6502/HarteTest_6502/cycle_t.h b/M6502/HarteTest_6502/cycle_t.h index 02ef863..a5b6877 100644 --- a/M6502/HarteTest_6502/cycle_t.h +++ b/M6502/HarteTest_6502/cycle_t.h @@ -11,5 +11,5 @@ public: cycle_t(const simdjson::dom::array input) noexcept : byte_t(input) {} - [[nodiscard]] auto action() const noexcept { return at(2).get_string(); } + [[nodiscard]] auto action() const noexcept { return string_at(2); } };