From 82fad58ade91e1751964f23c63de38f54953ed10 Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 4 Jun 2020 11:57:48 +0900 Subject: [PATCH] lib: simplify assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/33718 Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Anna Henningsen --- lib/internal/http2/util.js | 2 +- lib/internal/policy/sri.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index d069f726db7795..9025850469de7a 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -542,7 +542,7 @@ const assertWithinRange = hideStackFrames( function toHeaderObject(headers) { const obj = ObjectCreate(null); - for (var n = 0; n < headers.length; n = n + 2) { + for (var n = 0; n < headers.length; n += 2) { const name = headers[n]; let value = headers[n + 1]; if (name === HTTP2_HEADER_STATUS) diff --git a/lib/internal/policy/sri.js b/lib/internal/policy/sri.js index c4b5e7f1ca209a..ddb06a2e1a6051 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -58,7 +58,7 @@ const parse = (str) => { options: match[4] === undefined ? null : match[4], }) }); - prevIndex = prevIndex + match[0].length; + prevIndex += match[0].length; } if (prevIndex !== str.length) {