Skip to content

Commit

Permalink
BasicStructure: remove unnecessary size check while encoding
Browse files Browse the repository at this point in the history
This is already handled by `._validate_coded_message_size()`.

thanks to [at]kayoub5 for the catch!

Signed-off-by: Andreas Lauser <[email protected]>
Signed-off-by: Gerrit Ecke <[email protected]>
  • Loading branch information
andlaus committed Apr 22, 2024
1 parent 295f67e commit e8b4612
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions odxtools/basicstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ def convert_physical_to_internal(self,
if len(encode_state.coded_message) < self.byte_size:
# Padding bytes needed
encode_state.coded_message = encode_state.coded_message.ljust(self.byte_size, b"\0")
elif len(encode_state.coded_message) > self.byte_size:
odxraise(
f"Encoded structure {self.short_name} is too large: "
f"{len(encode_state.coded_message)} instead of {self.byte_size} "
f"bytes", EncodeError)
return

# encode the length- and table keys. This cannot be done above
# because we allow these to be defined implicitly (i.e. they
Expand Down

0 comments on commit e8b4612

Please sign in to comment.