Remove some unnecessary null checks in protocol.
This commit is contained in:
parent
6c0649aefc
commit
d26d5f56c8
@ -817,8 +817,4 @@ class BinaryEncoding:
|
||||
|
||||
encoder = BinaryEncoder(tree, self.__sanitize_encoding(encoding))
|
||||
data = encoder.get_data()
|
||||
|
||||
if data is not None:
|
||||
return struct.pack(">BBBB", BinaryEncoding.MAGIC, BinaryEncoding.COMPRESSED_WITH_DATA, encoding_magic, (~encoding_magic & 0xFF)) + data
|
||||
else:
|
||||
return None
|
||||
return struct.pack(">BBBB", BinaryEncoding.MAGIC, BinaryEncoding.COMPRESSED_WITH_DATA, encoding_magic, (~encoding_magic & 0xFF)) + data
|
||||
|
@ -80,9 +80,6 @@ class EAmuseProtocol:
|
||||
Returns:
|
||||
binary string representing transformed data
|
||||
"""
|
||||
if data is None:
|
||||
return None
|
||||
|
||||
key: Optional[bytes] = None
|
||||
if encryption_key:
|
||||
# Key is concatenated with the shared secret above
|
||||
@ -130,9 +127,6 @@ class EAmuseProtocol:
|
||||
Returns:
|
||||
binary string representing transformed data
|
||||
"""
|
||||
if data is None:
|
||||
return None
|
||||
|
||||
if compression is None or compression == 'none':
|
||||
# This isn't compressed
|
||||
return data
|
||||
@ -156,9 +150,6 @@ class EAmuseProtocol:
|
||||
Returns:
|
||||
binary string representing transformed data
|
||||
"""
|
||||
if data is None:
|
||||
return None
|
||||
|
||||
if compression is None or compression == 'none':
|
||||
# This isn't compressed
|
||||
return data
|
||||
|
Loading…
Reference in New Issue
Block a user