Skip to content

Commit

Permalink
Remove bytes() calls that are redundant with type signatures
Browse files Browse the repository at this point in the history
No effects were observed on Make-managed files.

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Oct 25, 2023
1 parent 2205d8e commit df0d122
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions indxparse/BinaryParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def read_byte(
- `OverrunBufferException`
"""
try:
return struct.unpack_from("<B", bytes(buf), offset)[0]
return struct.unpack_from("<B", buf, offset)[0]
except struct.error:
raise OverrunBufferException(offset, len(buf))

Expand All @@ -359,7 +359,7 @@ def read_word(
- `OverrunBufferException`
"""
try:
return struct.unpack_from("<H", bytes(buf), offset)[0]
return struct.unpack_from("<H", buf, offset)[0]
except struct.error:
raise OverrunBufferException(offset, len(buf))

Expand All @@ -377,7 +377,7 @@ def read_dword(
- `OverrunBufferException`
"""
try:
return struct.unpack_from("<I", bytes(buf), offset)[0]
return struct.unpack_from("<I", buf, offset)[0]
except struct.error:
raise OverrunBufferException(offset, len(buf))

Expand Down

0 comments on commit df0d122

Please sign in to comment.