aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/java.js
diff options
context:
space:
mode:
authorMatt Godbolt <matt@godbolt.org>2021-05-28 18:08:05 -0500
committerMatt Godbolt <matt@godbolt.org>2021-05-28 18:08:05 -0500
commita4edf7ed6bc51e73635faae652c631b4e0f13647 (patch)
tree53e1efb35bb97e2282226cb04c2d49405c463952 /lib/compilers/java.js
parentb5a6b45a9801d30998304b45d688701b943ae55f (diff)
downloadcompiler-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.js8
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};
}