From 313c568f63257257f6230b05d8f1279f75253ca0 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 16 Nov 2024 17:13:10 +0800 Subject: [PATCH] fix: python ffi compilation --- src/core_ffi/py_ffi/wrapper/cases.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core_ffi/py_ffi/wrapper/cases.cc b/src/core_ffi/py_ffi/wrapper/cases.cc index 065bc69..d00feff 100644 --- a/src/core_ffi/py_ffi/wrapper/cases.cc +++ b/src/core_ffi/py_ffi/wrapper/cases.cc @@ -13,7 +13,7 @@ PyCasesIter::PyCasesIter(const RangesUnion &data) : data_(data) {} PyCommonCode PyCasesIter::next() { while (head_ < 16) { - const auto &ranges = data_[head_]; + const auto &ranges = data_.ranges(head_); if (index_ < ranges.size()) { auto code = (static_cast(head_) << 32) | ranges[index_++]; return std::bit_cast(code); @@ -44,14 +44,14 @@ PyCommonCode PyCases::at(size_t index) const { uint64_t head = 0; for (;;) { - if (index >= data_ref()[head].size()) { - index -= data_ref()[head].size(); + if (index >= data_ref().ranges(head).size()) { + index -= data_ref().ranges(head).size(); ++head; } else { break; } } - uint32_t range = data_ref()[head][index]; + uint32_t range = data_ref().ranges(head)[index]; // TODO: fetch from RangesUnion[] const auto code = CommonCode::unsafe_create(head << 32 | range);