Skip to content

Commit 0f26a6c

Browse files
committed
Remove count argument from toByteArray extension function
This argument wasn't being used, so its presence was a bit misleading.
1 parent 5c1631a commit 0f26a6c

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

Sources/BigEndianByteReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class BigEndianByteReader: ByteReader {
4343
public func bytes(count: Int) -> [UInt8] {
4444
precondition(count >= 0)
4545
defer { offset += count }
46-
return data[offset..<offset + count].toByteArray(count)
46+
return data[offset..<offset + count].toByteArray()
4747
}
4848

4949
/**

Sources/Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension Data {
2323
}
2424

2525
@inlinable @inline(__always)
26-
func toByteArray(_ count: Int) -> [UInt8] {
26+
func toByteArray() -> [UInt8] {
2727
return self.withUnsafeBytes { $0.map { $0 } }
2828
}
2929

Sources/LittleEndianByteReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class LittleEndianByteReader: ByteReader {
4343
public func bytes(count: Int) -> [UInt8] {
4444
precondition(count >= 0)
4545
defer { offset += count }
46-
return data[offset..<offset + count].toByteArray(count)
46+
return data[offset..<offset + count].toByteArray()
4747
}
4848

4949
/**

Sources/LsbBitReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public final class LsbBitReader: BitReader {
318318
*/
319319
public func bytes(count: Int) -> [UInt8] {
320320
defer { offset += count }
321-
return data[offset..<offset + count].toByteArray(count)
321+
return data[offset..<offset + count].toByteArray()
322322
}
323323

324324
/**

Sources/MsbBitReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public final class MsbBitReader: BitReader {
321321
*/
322322
public func bytes(count: Int) -> [UInt8] {
323323
defer { offset += count }
324-
return data[offset..<offset + count].toByteArray(count)
324+
return data[offset..<offset + count].toByteArray()
325325
}
326326

327327
/**

0 commit comments

Comments
 (0)