Skip to content

Commit

Permalink
NFC: Rename DFS to depthFirstSeach
Browse files Browse the repository at this point in the history
  • Loading branch information
xedin committed May 7, 2024
1 parent eb4038c commit 982e279
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/Basics/Graph/GraphAlgorithms.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import struct OrderedCollections.OrderedSet
///
/// - Complexity: O(v + e) where (v, e) are the number of vertices and edges
/// reachable from the input nodes via the relation.
public func DFS<T: Hashable>(
public func depthFirstSearch<T: Hashable>(
_ nodes: [T],
successors: (T) throws -> [T],
onUnique: (T) -> Void,
Expand Down Expand Up @@ -54,4 +54,4 @@ public func DFS<T: Hashable>(
}
}
}
}
}
2 changes: 1 addition & 1 deletion Sources/PackageGraph/ModulesGraph+Loading.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extension ModulesGraph {
var allNodes = [GraphLoadingNode]()

// Cycles in dependencies don't matter as long as there are no target cycles between packages.
DFS(inputManifests.map { KeyedPair($0, key: $0.id) }) {
depthFirstSearch(inputManifests.map { KeyedPair($0, key: $0.id) }) {
$0.item.requiredDependencies.compactMap { dependency in
manifestMap[dependency.identity].map { (manifest, fileSystem) in
KeyedPair(
Expand Down
4 changes: 2 additions & 2 deletions Sources/Workspace/Workspace+Manifests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import struct Basics.InternalError
import class Basics.ObservabilityScope
import struct Basics.SwiftVersion
import func Basics.temp_await
import func Basics.DFS
import func Basics.depthFirstSearch
import class Basics.ThreadSafeKeyValueStore
import class Dispatch.DispatchGroup
import struct Dispatch.DispatchTime
Expand Down Expand Up @@ -533,7 +533,7 @@ extension Workspace {
}

var deduplication = [PackageIdentity: Int]()
try DFS(
try depthFirstSearch(
manifestGraphRoots,
successors: successorManifests
) { pair in
Expand Down

0 comments on commit 982e279

Please sign in to comment.