Skip to content
This repository was archived by the owner on Jan 5, 2020. It is now read-only.

Commit 67d0122

Browse files
author
draveness
committed
update sources
1 parent 0e5457a commit 67d0122

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/Hash+Mutate.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ public extension Hash {
2626
self = self.merge(otherHash, closure: closure)
2727
return self
2828
}
29+
30+
/// Removes all key-value pairs from hsh.
31+
///
32+
/// - Returns: Self with empty hash.
33+
@discardableResult mutating func clear() -> Hash<Key, Value> {
34+
self = [:]
35+
return self
36+
}
2937
}

0 commit comments

Comments
 (0)