Skip to content

Commit 1ac0384

Browse files
committed
[common_crypto] improve pref
1 parent e60fba0 commit 1ac0384

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/common_crypto/lib/src/tools.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ final CommonCryptoBindings bindings = CommonCryptoBindings(_dylib);
1919
extension Uint8ListPointer on Uint8List {
2020
Pointer<Uint8> get pointer {
2121
final pointer = malloc<Uint8>(length);
22-
for (var i = 0; i < length; i++) {
23-
pointer[i] = this[i];
24-
}
22+
final data = pointer.asTypedList(length);
23+
data.setAll(0, this);
2524
return pointer;
2625
}
2726
}

0 commit comments

Comments
 (0)