@@ -868,34 +868,25 @@ struct PersistentDict{K,V} <: AbstractDict{K,V}
868
868
@noinline function KeyValue. set (:: Type{PersistentDict{K, V}} , :: Nothing , key, val) where {K, V}
869
869
new {K, V} (HAMT. HAMT {K, V} (key => val))
870
870
end
871
- @noinline @Base . assume_effects :effect_free function KeyValue. set (dict:: PersistentDict{K, V} , key, val) where {K, V}
871
+ @noinline Base. @assume_effects :effect_free :terminates_globally KeyValue. set (
872
+ dict:: PersistentDict{K, V} , key, val) where {K, V} = @inline _keyvalueset (dict, key, val)
873
+ @noinline Base. @assume_effects :nothrow :effect_free :terminates_globally KeyValue. set (
874
+ dict:: PersistentDict{K, V} , key:: K , val:: V ) where {K, V} = @inline _keyvalueset (dict, key, val)
875
+ global function _keyvalueset (dict:: PersistentDict{K, V} , key, val) where {K, V}
872
876
trie = dict. trie
873
877
h = HAMT. HashState (key)
874
- found, present, trie, i, bi, top, hs = HAMT. path (trie, key, h, #= persistent=# true )
878
+ found, present, trie, i, bi, top, hs = HAMT. path (trie, key, h, #= persistent=# true )
875
879
HAMT. insert! (found, present, trie, i, bi, hs, val)
876
880
return new {K, V} (top)
877
881
end
878
- @noinline @Base . assume_effects :nothrow :effect_free function KeyValue. set (dict:: PersistentDict{K, V} , key:: K , val:: V ) where {K, V}
882
+ @noinline Base. @assume_effects :effect_free :terminates_globally KeyValue. set (
883
+ dict:: PersistentDict{K, V} , key) where {K, V} = @inline _keyvalueset (dict, key)
884
+ @noinline Base. @assume_effects :nothrow :effect_free :terminates_globally KeyValue. set (
885
+ dict:: PersistentDict{K, V} , key:: K ) where {K, V} = @inline _keyvalueset (dict, key)
886
+ global function _keyvalueset (dict:: PersistentDict{K, V} , key) where {K, V}
879
887
trie = dict. trie
880
888
h = HAMT. HashState (key)
881
- found, present, trie, i, bi, top, hs = HAMT. path (trie, key, h, #= persistent=# true )
882
- HAMT. insert! (found, present, trie, i, bi, hs, val)
883
- return new {K, V} (top)
884
- end
885
- @noinline @Base . assume_effects :effect_free function KeyValue. set (dict:: PersistentDict{K, V} , key) where {K, V}
886
- trie = dict. trie
887
- h = HAMT. HashState (key)
888
- found, present, trie, i, bi, top, _ = HAMT. path (trie, key, h, #= persistent=# true )
889
- if found && present
890
- deleteat! (trie. data, i)
891
- HAMT. unset! (trie, bi)
892
- end
893
- return new {K, V} (top)
894
- end
895
- @noinline @Base . assume_effects :nothrow :effect_free function KeyValue. set (dict:: PersistentDict{K, V} , key:: K ) where {K, V}
896
- trie = dict. trie
897
- h = HAMT. HashState (key)
898
- found, present, trie, i, bi, top, _ = HAMT. path (trie, key, h, #= persistent=# true )
889
+ found, present, trie, i, bi, top, _ = HAMT. path (trie, key, h, #= persistent=# true )
899
890
if found && present
900
891
deleteat! (trie. data, i)
901
892
HAMT. unset! (trie, bi)
0 commit comments