Skip to content

Commit

Permalink
Allow clearing a Set without mutating its fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Mar 27, 2012
1 parent 2059231 commit 8145560
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/set.jl
Expand Up @@ -26,7 +26,7 @@ del_each(s::Set, xs) = (for x=xs; del(s,x); end; s)
similar{T}(s::Set{T}) = Set{T}()
copy(s::Set) = add_each(similar(s), s)

del_all{T}(s::Set{T}) = (s.hash = HashTable{T,Bool}(); s)
del_all{T}(s::Set{T}) = (del_all(s.hash); s)

start(s::Set) = start(s.hash)
done(s::Set, state) = done(s.hash, state)
Expand Down

0 comments on commit 8145560

Please sign in to comment.