alternative isEmpty implementation in string-set.sml
This commit is contained in:
BIN
bench/insert-string-set
Executable file
BIN
bench/insert-string-set
Executable file
Binary file not shown.
@@ -67,7 +67,10 @@ struct
|
|||||||
val empty =
|
val empty =
|
||||||
CHILDREN {keys = Vector.fromList [], children = Vector.fromList []}
|
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 =
|
fun fromString str =
|
||||||
if String.size str > 0 then
|
if String.size str > 0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user