mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 08:24:55 -05:00
re-order type check for more speed
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user