Skip to content

Commit

Permalink
CircularBuffer.Index: remove bogus assert (#978)
Browse files Browse the repository at this point in the history
Motivation:

CircularBuffer.Index was asserting that its size is the same as a word.
Whilst that's true on 64-bit architectures, the assert itself is bogus
and a left-over from development.

Modifications:

Remove bogus assert.

Result:

Better 32-bit support.
  • Loading branch information
weissi authored Apr 23, 2019
1 parent f6692f5 commit 2cfa777
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/NIO/CircularBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ public struct CircularBuffer<Element>: CustomStringConvertible {
// if we can, we store the check for the backing here
self._backingCheck = backingCount < Int(_UInt24.max) ? _UInt24(UInt32(backingCount)) : .max
}
assert(MemoryLayout.size(ofValue: self) == MemoryLayout<Int>.size)
}

@inlinable
public static func < (lhs: Index, rhs: Index) -> Bool {
if lhs.isIndexGEQHeadIndex && rhs.isIndexGEQHeadIndex {
Expand Down

0 comments on commit 2cfa777

Please sign in to comment.