diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-17 13:04:28 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-17 20:20:06 -0400 |
commit | 213885a9d00a913e3fd2eb21a5992efb63c888f5 (patch) | |
tree | 7ac1c5ffad1c3125d72155e40ef5ea75c39945ba /js/read_dir.ts | |
parent | 4e2e185de74edaf49d77983c935686616ba9d07c (diff) |
Optimization: Reuse ArrayBuffer during serialization.
Diffstat (limited to 'js/read_dir.ts')
-rw-r--r-- | js/read_dir.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/read_dir.ts b/js/read_dir.ts index 6be89d6b5..efeea4268 100644 --- a/js/read_dir.ts +++ b/js/read_dir.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"; import { FileInfo, FileInfoImpl } from "./file_info"; import { assert } from "./util"; @@ -25,7 +25,7 @@ export async function readDir(path: string): Promise<FileInfo[]> { } function req(path: string): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] { - const builder = new flatbuffers.Builder(); + const builder = flatbuffers.createBuilder(); const path_ = builder.createString(path); msg.ReadDir.startReadDir(builder); msg.ReadDir.addPath(builder, path_); |