re-order type check for more speed

This commit is contained in:
protolambda 2019-06-11 18:08:27 +02:00
parent 85b0c237ca
commit 22f624e12e
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 1 additions and 3 deletions

View File

@ -513,13 +513,11 @@ def read_vector_elem_type(vector_typ: Type[Vector[T, L]]) -> T:
def read_elem_type(typ):
if typ == bytes:
if issubclass(typ, bytes): # bytes or bytesN
return byte
elif is_list_type(typ):
return read_list_elem_type(typ)
elif is_vector_type(typ):
return read_vector_elem_type(typ)
elif issubclass(typ, bytes): # bytes or bytesN
return byte
else:
raise TypeError("Unexpected type: {}".format(typ))