From c9fbcaf5919d0d544b377791b1dda12d85a60dd1 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 19 Jan 2017 23:41:17 -0500 Subject: [PATCH] remove unnecessary slice in SSR renderStyle (small perf gain) --- src/platforms/web/server/modules/style.js | 2 +- test/ssr/ssr-string.spec.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/platforms/web/server/modules/style.js b/src/platforms/web/server/modules/style.js index 69fccd10..8c66ed01 100644 --- a/src/platforms/web/server/modules/style.js +++ b/src/platforms/web/server/modules/style.js @@ -8,7 +8,7 @@ function genStyleText (vnode: VNode): string { for (const key in style) { styleText += `${hyphenate(key)}:${style[key]};` } - return styleText.slice(0, -1) + return styleText } export default function renderStyle (vnode: VNodeWithData): ?string { diff --git a/test/ssr/ssr-string.spec.js b/test/ssr/ssr-string.spec.js index 808a86cc..c8049560 100644 --- a/test/ssr/ssr-string.spec.js +++ b/test/ssr/ssr-string.spec.js @@ -102,7 +102,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() }) @@ -116,7 +116,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() }) @@ -135,7 +135,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() }) @@ -159,7 +159,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() }) @@ -178,7 +178,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() }) @@ -197,7 +197,7 @@ describe('SSR: renderToString', () => { } }, result => { expect(result).toContain( - '
' + '
' ) done() })