alternative isEmpty implementation in string-set.sml

This commit is contained in:
2024-09-09 18:22:56 +01:00
parent 6228a259bc
commit ede0da6643
2 changed files with 4 additions and 1 deletions

BIN
bench/insert-string-set Executable file

Binary file not shown.

View File

@@ -67,7 +67,10 @@ struct
val empty =
CHILDREN {keys = Vector.fromList [], children = Vector.fromList []}
fun isEmpty trie = trie = empty
fun isEmpty trie =
case trie of
CHILDREN {keys, ...} => Vector.length keys = 0
| _ => false
fun fromString str =
if String.size str > 0 then