Skip to content

Commit

Permalink
Docs for processed(_:)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Apr 14, 2024
1 parent 834fed5 commit e2c6700
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/RangeState/RangeProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ extension RangeProcessor {
return processed(location)
}

public func processed(_ location: Int) -> Bool {
/// Check for the processed state of a location.
///
/// This method will not cause any processing to occur.
public func processed(_ location: Int) -> Bool {
precondition(location >= 0)

guard let maximumProcessedLocation else { return false }

return maximumProcessedLocation >= location
}
}

public func processed(_ range: NSRange) -> Bool {
processed(range.location)
Expand Down

0 comments on commit e2c6700

Please sign in to comment.