codegen performance: use trim-right instead of lodash/trimEnd (#5255)

This commit is contained in:
jwbay
2017-02-09 16:04:43 -05:00
committed by Logan Smyth
parent fb0a91b750
commit 1a325ce5d5
2 changed files with 6 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import type SourceMap from "./source-map";
import trimEnd from "lodash/trimEnd";
import trimRight from "trim-right";
const SPACES_RE = /^[ \t]+$/;
@@ -40,7 +40,9 @@ export default class Buffer {
const map = this._map;
const result = {
code: trimEnd(this._buf.join("")),
// Whatever trim is used here should not execute a regex against the
// source string since it may be arbitrarily large after all transformations
code: trimRight(this._buf.join("")),
map: null,
rawMappings: map && map.getRawMappings(),
};