Skip to content

Commit 9f109f2

Browse files
committed
BitReader.bit() now returns UInt8 instead of Int
Now it is consistent with return type of bits().
1 parent b737d19 commit 9f109f2

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Sources/BitReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public protocol BitReader: class {
1616
// TODO: Rename?
1717
func intFromBits(count: Int) -> Int
1818

19-
func bit() -> Int
19+
func bit() -> UInt8
2020

2121
// TODO: Describe, that it doesn't check for the end.
2222
func align()

Sources/LsbBitReader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public final class LsbBitReader: ByteReader, BitReader {
5656
return result
5757
}
5858

59-
public func bit() -> Int {
60-
let bit = self.data[self.offset] & self.bitMask > 0 ? 1 : 0
59+
public func bit() -> UInt8 {
60+
let bit: UInt8 = self.data[self.offset] & self.bitMask > 0 ? 1 : 0
6161

6262
if self.bitMask == 128 {
6363
self.offset += 1

Sources/MsbBitReader.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public final class MsbBitReader: ByteReader, BitReader {
5656
return result
5757
}
5858

59-
public func bit() -> Int {
60-
let bit = self.data[self.offset] & self.bitMask > 0 ? 1 : 0
59+
public func bit() -> UInt8 {
60+
let bit: UInt8 = self.data[self.offset] & self.bitMask > 0 ? 1 : 0
6161

6262
if self.bitMask == 1 {
6363
self.offset += 1

0 commit comments

Comments
 (0)