diff --git a/lib/aiken/collection/dict.ak b/lib/aiken/collection/dict.ak index a984e0b..835ce30 100644 --- a/lib/aiken/collection/dict.ak +++ b/lib/aiken/collection/dict.ak @@ -379,10 +379,7 @@ fn do_has_key(self: Pairs, key k: ByteArray) -> Bool { /// dict.is_empty(dict.empty) == True /// ``` pub fn is_empty(self: Dict) -> Bool { - when self.inner is { - [] -> True - _ -> False - } + builtin.null_list(self.inner) } /// Extract all the keys present in a given `Dict`. diff --git a/lib/aiken/collection/list.ak b/lib/aiken/collection/list.ak index ef6a93d..ab0f461 100644 --- a/lib/aiken/collection/list.ak +++ b/lib/aiken/collection/list.ak @@ -205,10 +205,7 @@ pub fn head(self: List) -> Option { /// list.is_empty([1, 2, 3]) == False /// ``` pub fn is_empty(self: List) -> Bool { - when self is { - [] -> True - _ -> False - } + builtin.null_list(self) } /// Gets the index of an element of a list, if any. Otherwise, returns None.