From 3e9810678ad887a3e63b82479d05accf2adf7d65 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 4 Dec 2017 20:13:56 +0300 Subject: [PATCH] fixup 0e61de29: use break/continue instead of return fixes #282 --- edit/sections.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/edit/sections.js b/edit/sections.js index 696c3fea..93d5b956 100644 --- a/edit/sections.js +++ b/edit/sections.js @@ -390,11 +390,11 @@ function getSections() { function getSectionsHashes() { const sections = []; - getSections().forEach(div => { + for (const div of getSections()) { const meta = {urls: [], urlPrefixes: [], domains: [], regexps: []}; for (const li of $('.applies-to-list', div).childNodes) { if (li.className === template.appliesToEverything.className) { - return; + break; } const type = $('[name=applies-type]', li).value; const value = $('[name=applies-value]', li).value; @@ -404,11 +404,11 @@ function getSectionsHashes() { } const code = div.CodeMirror.getValue(); if (/^\s*$/.test(code) && Object.keys(meta).length === 0) { - return; + continue; } meta.code = code; sections.push(meta); - }); + } return sections; }