mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibJS: Use copy_data_block_bytes() instead of overwrite() and copy_to()
Replaces usage of ByteBuffer::overwrite() and combinations of Span::slice() + Span::copy_to() with AO CopyDataBlockBytes.
This commit is contained in:
committed by
Andreas Kling
parent
f3fb005653
commit
ce2b88e7cc
Notes:
sideshowbarker
2024-07-17 01:55:29 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/ce2b88e7cc Pull-request: https://github.com/SerenityOS/serenity/pull/19467 Reviewed-by: https://github.com/trflynn89 ✅
@@ -176,8 +176,7 @@ ThrowCompletionOr<ArrayBuffer*> clone_array_buffer(VM& vm, ArrayBuffer& source_b
|
||||
auto& target_block = target_buffer->buffer();
|
||||
|
||||
// 5. Perform CopyDataBlockBytes(targetBlock, 0, srcBlock, srcByteOffset, srcLength).
|
||||
// FIXME: This is only correct for ArrayBuffers, once SharedArrayBuffer is implemented, the AO has to be implemented
|
||||
target_block.overwrite(0, source_block.offset_pointer(source_byte_offset), source_length);
|
||||
copy_data_block_bytes(target_block, 0, source_block, source_byte_offset, source_length);
|
||||
|
||||
// 6. Return targetBuffer.
|
||||
return target_buffer;
|
||||
|
||||
Reference in New Issue
Block a user