diff options
author | Matt Godbolt <matt@godbolt.org> | 2021-05-28 18:08:05 -0500 |
---|---|---|
committer | Matt Godbolt <matt@godbolt.org> | 2021-05-28 18:08:05 -0500 |
commit | a4edf7ed6bc51e73635faae652c631b4e0f13647 (patch) | |
tree | 53e1efb35bb97e2282226cb04c2d49405c463952 /lib/compilers/java.js | |
parent | b5a6b45a9801d30998304b45d688701b943ae55f (diff) | |
download | compiler-explorer-a4edf7ed6bc51e73635faae652c631b4e0f13647.tar.gz compiler-explorer-a4edf7ed6bc51e73635faae652c631b4e0f13647.zip |
No array for each
Diffstat (limited to 'lib/compilers/java.js')
-rw-r--r-- | lib/compilers/java.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compilers/java.js b/lib/compilers/java.js index 2d90856eb..677eeb323 100644 --- a/lib/compilers/java.js +++ b/lib/compilers/java.js @@ -155,7 +155,7 @@ export class JavaCompiler extends BaseCompiler { parseds.sort((o1, o2) => o1.firstSourceLine - o2.firstSourceLine); const segments = []; - parseds.forEach((parsed, classNumber) => { + for (const [classNumber, parsed] of parseds.entries()) { if (classNumber > 0) { // Separate classes with two line breaks segments.push({text: '', source: null}, {text: '', source: null}); @@ -178,12 +178,12 @@ export class JavaCompiler extends BaseCompiler { // textsBeforeMethod[last] is actually *after* the last method. // Check whether there is a method following the text block if (i < parsed.methods.length) { - parsed.methods[i].instructions.forEach(({text, sourceLine}) => { + for (const {text, sourceLine} of parsed.methods[i].instructions) { segments.push({text: text, source: {file: null, line: sourceLine}}); - }); + } } } - }); + } return {asm: segments}; } |