Skip to content

Commit 89993bd

Browse files
committed
Directly call uintX(fromBytes:) functions instead of no-argument versions of them
This reduces number of function-calls by 1.
1 parent ba45f5b commit 89993bd

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Sources/LsbBitReader.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public final class LsbBitReader: ByteReader, BitReader {
304304
*/
305305
public override func uint64() -> UInt64 {
306306
precondition(isAligned, "BitReader is not aligned.")
307-
return super.uint64()
307+
return super.uint64(fromBytes: 8)
308308
}
309309

310310
/**
@@ -327,7 +327,7 @@ public final class LsbBitReader: ByteReader, BitReader {
327327
*/
328328
public override func uint32() -> UInt32 {
329329
precondition(isAligned, "BitReader is not aligned.")
330-
return super.uint32()
330+
return super.uint32(fromBytes: 4)
331331
}
332332

333333
/**
@@ -350,7 +350,7 @@ public final class LsbBitReader: ByteReader, BitReader {
350350
*/
351351
public override func uint16() -> UInt16 {
352352
precondition(isAligned, "BitReader is not aligned.")
353-
return super.uint16()
353+
return super.uint16(fromBytes: 2)
354354
}
355355

356356
/**

Sources/MsbBitReader.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public final class MsbBitReader: ByteReader, BitReader {
304304
*/
305305
public override func uint64() -> UInt64 {
306306
precondition(isAligned, "BitReader is not aligned.")
307-
return super.uint64()
307+
return super.uint64(fromBytes: 8)
308308
}
309309

310310
/**
@@ -327,7 +327,7 @@ public final class MsbBitReader: ByteReader, BitReader {
327327
*/
328328
public override func uint32() -> UInt32 {
329329
precondition(isAligned, "BitReader is not aligned.")
330-
return super.uint32()
330+
return super.uint32(fromBytes: 4)
331331
}
332332

333333
/**
@@ -350,7 +350,7 @@ public final class MsbBitReader: ByteReader, BitReader {
350350
*/
351351
public override func uint16() -> UInt16 {
352352
precondition(isAligned, "BitReader is not aligned.")
353-
return super.uint16()
353+
return super.uint16(fromBytes: 2)
354354
}
355355

356356
/**

0 commit comments

Comments
 (0)