Skip to content

Commit 8199039

Browse files
committed
Use recent NativeCall's Blob support for speedup
1 parent 3cce952 commit 8199039

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/Inline/Python.pm6

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ sub py_string_to_buf(OpaquePointer, CArray[CArray[int8]])
117117
sub py_str_to_py(Int, Str)
118118
returns OpaquePointer { ... }
119119
native(&py_str_to_py);
120-
sub py_buf_to_py(Int, CArray[uint8])
120+
sub py_buf_to_py(Int, Blob)
121121
returns OpaquePointer { ... }
122122
native(&py_buf_to_py);
123123
sub py_tuple_new(Int)
@@ -271,11 +271,7 @@ multi method p6_to_py(Str:D $value) returns OpaquePointer {
271271
}
272272

273273
multi method p6_to_py(blob8:D $value) returns OpaquePointer {
274-
my $array = CArray[uint8].new();
275-
for ^$value.elems {
276-
$array[$_] = $value[$_];
277-
}
278-
py_buf_to_py($value.elems, $array);
274+
py_buf_to_py($value.elems, $value);
279275
}
280276

281277
multi method p6_to_py(Positional:D $value) returns OpaquePointer {

0 commit comments

Comments
 (0)