summaryrefslogtreecommitdiff
path: root/js/copy_file.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-17 13:04:28 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-17 20:20:06 -0400
commit213885a9d00a913e3fd2eb21a5992efb63c888f5 (patch)
tree7ac1c5ffad1c3125d72155e40ef5ea75c39945ba /js/copy_file.ts
parent4e2e185de74edaf49d77983c935686616ba9d07c (diff)
Optimization: Reuse ArrayBuffer during serialization.
Diffstat (limited to 'js/copy_file.ts')
-rw-r--r--js/copy_file.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/copy_file.ts b/js/copy_file.ts
index 79d74e034..255d977bf 100644
--- a/js/copy_file.ts
+++ b/js/copy_file.ts
@@ -1,6 +1,6 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import * as msg from "gen/msg_generated";
-import { flatbuffers } from "flatbuffers";
+import * as flatbuffers from "./flatbuffers";
import * as dispatch from "./dispatch";
/** Copies the contents of a file to another by name synchronously.
@@ -36,7 +36,7 @@ function req(
from: string,
to: string
): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] {
- const builder = new flatbuffers.Builder();
+ const builder = flatbuffers.createBuilder();
const from_ = builder.createString(from);
const to_ = builder.createString(to);
msg.CopyFile.startCopyFile(builder);