Skip to content

Commit 90247fe

Browse files
committed
make MockHashAlgorithm thread safe
1 parent c5b3735 commit 90247fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SPMTestSupport/MockHashAlgorithm.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99
*/
1010

11+
import Basics
1112
import TSCBasic
1213

1314
public class MockHashAlgorithm: HashAlgorithm {
1415
public typealias Hash = (ByteString) -> ByteString
1516

16-
public private(set) var hashes: [ByteString] = []
17+
public private(set) var hashes = ThreadSafeArrayStore<ByteString>()
1718
private var hashFunction: Hash!
1819

1920
public init(hash: Hash? = nil) {

0 commit comments

Comments
 (0)