diff --git a/include/cpp/jank/runtime/detail/native_persistent_list.hpp b/include/cpp/jank/runtime/detail/native_persistent_list.hpp index ad15a1605..54916baec 100644 --- a/include/cpp/jank/runtime/detail/native_persistent_list.hpp +++ b/include/cpp/jank/runtime/detail/native_persistent_list.hpp @@ -178,6 +178,11 @@ namespace jank::runtime::detail return data ? data->length : 0; } + native_bool empty() const + { + return data ? data->length == 0 : true; + } + option first() const { if(data) diff --git a/src/cpp/jank/runtime/context.cpp b/src/cpp/jank/runtime/context.cpp index 019f9ec53..119b479c5 100644 --- a/src/cpp/jank/runtime/context.cpp +++ b/src/cpp/jank/runtime/context.cpp @@ -512,7 +512,7 @@ namespace jank::runtime } else { - if(typed_o->data.data->length == 0) + if(typed_o->data.empty()) { return typed_o; }