Used Uint8List instead of List for performance improvement.
The method is called fromBytes so it's likely that the parameter passed will be of type Uint8List. Now the List.setRange() implementation will copy the list element-wise, while Uint8List.setRange(), when passed another Uint8List, will use native code optimized to copy arbitrarily sized chunks of bytes.
Used Uint8List instead of List for performance improvement.
The method is called
fromBytes
so it's likely that the parameter passed will be of typeUint8List
. Now theList.setRange()
implementation will copy the list element-wise, whileUint8List.setRange()
, when passed anotherUint8List
, will use native code optimized to copy arbitrarily sized chunks of bytes.