Skip to content

Commit 982e279

Browse files
committed
NFC: Rename DFS to depthFirstSeach
1 parent eb4038c commit 982e279

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/Basics/Graph/GraphAlgorithms.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import struct OrderedCollections.OrderedSet
2525
///
2626
/// - Complexity: O(v + e) where (v, e) are the number of vertices and edges
2727
/// reachable from the input nodes via the relation.
28-
public func DFS<T: Hashable>(
28+
public func depthFirstSearch<T: Hashable>(
2929
_ nodes: [T],
3030
successors: (T) throws -> [T],
3131
onUnique: (T) -> Void,
@@ -54,4 +54,4 @@ public func DFS<T: Hashable>(
5454
}
5555
}
5656
}
57-
}
57+
}

Sources/PackageGraph/ModulesGraph+Loading.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension ModulesGraph {
6969
var allNodes = [GraphLoadingNode]()
7070

7171
// Cycles in dependencies don't matter as long as there are no target cycles between packages.
72-
DFS(inputManifests.map { KeyedPair($0, key: $0.id) }) {
72+
depthFirstSearch(inputManifests.map { KeyedPair($0, key: $0.id) }) {
7373
$0.item.requiredDependencies.compactMap { dependency in
7474
manifestMap[dependency.identity].map { (manifest, fileSystem) in
7575
KeyedPair(

Sources/Workspace/Workspace+Manifests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import struct Basics.InternalError
1616
import class Basics.ObservabilityScope
1717
import struct Basics.SwiftVersion
1818
import func Basics.temp_await
19-
import func Basics.DFS
19+
import func Basics.depthFirstSearch
2020
import class Basics.ThreadSafeKeyValueStore
2121
import class Dispatch.DispatchGroup
2222
import struct Dispatch.DispatchTime
@@ -533,7 +533,7 @@ extension Workspace {
533533
}
534534

535535
var deduplication = [PackageIdentity: Int]()
536-
try DFS(
536+
try depthFirstSearch(
537537
manifestGraphRoots,
538538
successors: successorManifests
539539
) { pair in

0 commit comments

Comments
 (0)