Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in comments and private code naming #483

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/TSCBasic/Closable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

/// Closable entity is one that manages underlying resources and needs to be closed for cleanup
/// The intent of this method is for the sole owner of the refernece/handle of the resource to close it completely, comapred to releasing a shared resource.
/// The intent of this method is for the sole owner of the reference/handle of the resource to close it completely, compared to releasing a shared resource.
public protocol Closable {
func close() throws
}
2 changes: 1 addition & 1 deletion Sources/TSCBasic/CollectionExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension Collection {
extension Collection where Element: Hashable {
/// Returns a new list of element removing duplicate elements.
///
/// Note: The order of elements is preseved.
/// Note: The order of elements is preserved.
/// Complexity: O(n)
public func spm_uniqueElements() -> [Element] {
var set = Set<Element>()
Expand Down
2 changes: 1 addition & 1 deletion Sources/TSCBasic/DeltaAlgorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public struct DeltaAlgorithm<Change: Hashable>: Sendable {
return result
}

/// Minimizes a set of `changes` which has been partioned into smaller sets,
/// Minimizes a set of `changes` which has been partitioned into smaller sets,
/// by attempting to remove individual subsets.
func delta(
changes: Set<Change>,
Expand Down
4 changes: 2 additions & 2 deletions Sources/TSCBasic/HashAlgorithms.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct InternalSHA256: HashAlgorithm {
private static let blockBitSize = 512

/// The initial hash value.
private static let initalHashValue: [UInt32] = [
private static let initialHashValue: [UInt32] = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
]

Expand Down Expand Up @@ -89,7 +89,7 @@ struct InternalSHA256: HashAlgorithm {
let messageBlocks = input.blocks(size: Self.blockBitSize / 8)

/// The hash that is being computed.
var hash = Self.initalHashValue
var hash = Self.initialHashValue

// Process each block.
for block in messageBlocks {
Expand Down
2 changes: 1 addition & 1 deletion Sources/TSCBasic/SortedArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public struct SortedArray<Element>: CustomStringConvertible {

var lhs = elements[lhsIndex], rhs = newElements[rhsIndex]

// Equivalent to a merge sort, "pop" and append the max elemeent of
// Equivalent to a merge sort, "pop" and append the max element of
// each array until either array is empty.
for index in elements.indices.reversed() {
if areInIncreasingOrder(lhs, rhs) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/TSCBasic/TemporaryFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public func determineTempDirectory(_ dir: AbsolutePath? = nil) throws -> Absolut
return tmpDir
}

/// The closure argument of the `body` closue of `withTemporaryFile`.
/// The closure argument of the `body` closure of `withTemporaryFile`.
public struct TemporaryFile {
/// If specified during init, the temporary file name begins with this prefix.
let prefix: String
Expand Down