     @inlinable
     public var count: Int {
         if self.tailBackingIndex >= self.headBackingIndex {
-            return self.tailBackingIndex - self.headBackingIndex
+            return self.tailBackingIndex &- self.headBackingIndex
         } else {
-            return self._buffer.count - (self.headBackingIndex - self.tailBackingIndex)
+            return self._buffer.count &- (self.headBackingIndex &- self.tailBackingIndex)
         }
     }
 

        if self.headBackingIndex > 0 {
            newBacking.append(contentsOf: self._buffer[0..<self.headBackingIndex])
        }
        let repeatitionCount = newCapacity - newBacking.count
        newBacking.append(contentsOf: repeatElement(nil, count: repeatitionCount))
        self.headBackingIndex = 0
        self.tailBackingIndex = newBacking.count - repeatitionCount
        self._buffer = newBacking
        assert(self.verifyInvariants())
    }


    @inlinable
    internal var mask: Int {
        return self._buffer.count &- 1
    }

    @inlinable
