Skip to content

Commit da88161

Browse files
Reuse DataView as much as possible
1 parent d5909d5 commit da88161

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Runtime/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,9 @@ export class SwiftRuntime {
751751
throw new Error("threadChannel is not set in options given to SwiftRuntime. Please set it to request transferring objects.");
752752
}
753753
const broker = getMessageBroker(this.options.threadChannel);
754-
const sendingObjects = decodeObjectRefs(sending_objects, sending_objects_count, this.getDataView());
755-
const transferringObjects = decodeObjectRefs(transferring_objects, transferring_objects_count, this.getDataView());
754+
const dataView = this.getDataView();
755+
const sendingObjects = decodeObjectRefs(sending_objects, sending_objects_count, dataView);
756+
const transferringObjects = decodeObjectRefs(transferring_objects, transferring_objects_count, dataView);
756757
broker.request({
757758
type: "request",
758759
data: {

0 commit comments

Comments
 (0)