mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
This sanitizes the semantics of _Node.Builder, removing the (unneccessary) need to pass around hash paths. It also slightly refactors removal operations, but stops short of implementing node shrinking. # Conflicts: # Sources/PersistentCollections/Node/_Node+Builder.swift # Sources/PersistentCollections/Node/_Node+Initializers.swift # Sources/PersistentCollections/Node/_Node+Structural intersection.swift # Sources/PersistentCollections/Node/_Node+Structural subtracting.swift # Sources/PersistentCollections/Node/_Node+Subtree Modify.swift # Sources/PersistentCollections/Node/_Node+Subtree Removals.swift # Sources/PersistentCollections/PersistentDictionary/PersistentDictionary+Initializers.swift # Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra Initializers.swift # Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra intersection.swift # Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra subtracting.swift
38 lines
999 B
Swift
38 lines
999 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Collections open source project
|
|
//
|
|
// Copyright (c) 2022 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import _CollectionsUtilities
|
|
|
|
extension PersistentSet {
|
|
public static var _isConsistencyCheckingEnabled: Bool {
|
|
_isCollectionsInternalCheckingEnabled
|
|
}
|
|
|
|
@inlinable
|
|
public func _invariantCheck() {
|
|
_root._fullInvariantCheck()
|
|
}
|
|
|
|
public func _dump(iterationOrder: Bool = false) {
|
|
_root.dump(iterationOrder: iterationOrder)
|
|
}
|
|
|
|
public static var _maxDepth: Int {
|
|
_Level.limit
|
|
}
|
|
|
|
public var _statistics: _HashTreeStatistics {
|
|
var stats = _HashTreeStatistics()
|
|
_root.gatherStatistics(.top, &stats)
|
|
return stats
|
|
}
|
|
}
|