Skip to content

Commit

Permalink
Fix some symbol documentation formatting and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ejmarchant committed Aug 13, 2021
1 parent cb6bfdc commit 872010e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ extension SparseSet.Elements.SubSequence: RandomAccessCollection {
/// `distance > 0`, `limit` has no effect if it is less than `i`.
/// Likewise, if `distance < 0`, `limit` has no effect if it is greater
/// than `i`.
///
/// - Returns: An index offset by `distance` from the index `i`, unless that
/// index would be beyond `limit` in the direction of movement. In that
/// case, the method returns `nil`.
Expand Down
8 changes: 4 additions & 4 deletions Sources/SparseSetModule/SparseSet+SparseStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extension SparseSet.SparseStorage {
_buffer.header.capacity
}

/// Resize this index table to a new capacity.
/// Resize this storage to a new capacity.
///
/// The underlying buffer is replaced with a new one and its contents are
/// copied.
Expand All @@ -135,7 +135,7 @@ extension SparseSet.SparseStorage {
_buffer = Buffer.bufferWith(capacity: newCapacity, contentsOf: _buffer)
}

/// Resize this index table to a new capacity.
/// Resize this storage to a new capacity.
///
/// The underlying buffer is replaced with a new one. The contents of the
/// new buffer is initialized from the provided `keys` collection. This
Expand All @@ -150,9 +150,9 @@ extension SparseSet.SparseStorage {
_buffer = Buffer.bufferWith(capacity: newCapacity, keys: keys)
}

/// Rebuilds the index data for the given key data.
/// Rebuilds the index data for the given keys.
///
/// - Parameter indices: A collection of keys.
/// - Parameter keys: A collection of keys.
@inlinable
internal mutating func reindex<C: Collection>(keys: C) where C.Element == Key {
assert(capacity >= keys.max().map { Int($0) + 1 } ?? 0)
Expand Down
3 changes: 2 additions & 1 deletion Sources/SparseSetModule/SparseSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ extension SparseSet {
/// - Note: Do not use this subscript to modify sparse set values if the
/// sparse set's `Value` type is a class. In that case, the default value
/// and key are not written back to the sparse set after an operation. (For
/// a variant of this operation that supports this usecase, see
/// a variant of this operation that supports this use case, see
/// `modifyValue(forKey:default:_:)`.)
///
/// - Parameters:
Expand Down Expand Up @@ -486,6 +486,7 @@ extension SparseSet {
/// - Parameter transform: A closure that transforms a value. `transform`
/// accepts each value of the sparse set as its parameter and returns a
/// transformed value of the same or of a different type.
///
/// - Returns: A sparse set containing the keys and transformed values of
/// this sparse set.
///
Expand Down

0 comments on commit 872010e

Please sign in to comment.