From 11ef77245353675722f880dac7602c712af2d00f Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 4 Jun 2020 11:57:48 +0900 Subject: [PATCH] lib: simplify assignment --- 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 2ef0824cf760bc..f26b7dc5d81a83 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 d70df5c1aa1f7b..d7e554fbb64c7c 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -54,7 +54,7 @@ const parse = (str) => { options: match[4] === undefined ? null : match[4], }) }); - prevIndex = prevIndex + match[0].length; + prevIndex += match[0].length; } if (prevIndex !== str.length) {