Skip to content

Commit

Permalink
[NBKCoreKit] Cleanup (#98).
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Oct 8, 2023
1 parent 659249e commit 6f4baff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Sources/NBKCoreKit/Private/NBK+Division.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ extension NBK {
@inlinable public static func leastPositiveResidueReportingOverflow<T: BinaryInteger>(
of dividend: T, dividingBy divisor: UInt) -> PVO<UInt> {
//=--------------------------------------=
if divisor.isZero {
guard let divisor = NBK.NonZero(exactly: divisor) else {
return PVO(dividend._lowWord, true)
}
//=--------------------------------------=
return PVO(self.leastPositiveResidue(of: dividend, dividingBy: NonZero(unchecked: divisor)), false)
return PVO(self.leastPositiveResidue(of: dividend, dividingBy: divisor), false)
}

//=------------------------------------------------------------------------=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ extension NBK.StrictUnsignedInteger.SubSequence {
@inlinable public static func remainderReportingOverflow(
_ base: Base, dividingBy divisor: Base.Element, in range: Range<Base.Index>) -> PVO<Base.Element> {
//=--------------------------------------=
if divisor.isZero {
guard let divisor = NBK.NonZero(exactly: divisor) else {
return PVO(range.isEmpty ? 0 as Base.Element : base[range.lowerBound], true)
}
//=--------------------------------------=
return PVO(self.remainder(base, dividingBy: NBK.NonZero(unchecked: divisor), in: range), false)
return PVO(self.remainder(base, dividingBy: divisor, in: range), false)
}

//=------------------------------------------------------------------------=
Expand Down Expand Up @@ -133,11 +133,11 @@ extension NBK.StrictUnsignedInteger.SubSequence where Base: MutableCollection {
@inlinable public static func formQuotientWithRemainderReportingOverflow(
_ base: inout Base, dividingBy divisor: Base.Element, in range: Range<Base.Index>) -> PVO<Base.Element> {
//=--------------------------------------=
if divisor.isZero {
guard let divisor = NBK.NonZero(exactly: divisor) else {
return PVO(range.isEmpty ? 0 as Base.Element : base[range.lowerBound], true)
}
//=--------------------------------------=
return PVO(self.formQuotientWithRemainder(&base, dividingBy: NBK.NonZero(unchecked: divisor), in: range), false)
return PVO(self.formQuotientWithRemainder(&base, dividingBy: divisor, in: range), false)
}

//=------------------------------------------------------------------------=
Expand Down

0 comments on commit 6f4baff

Please sign in to comment.