diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/EliminateLoopsHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/EliminateLoopsHelper.java index 3bad6c6..bf94124 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/EliminateLoopsHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/EliminateLoopsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,10 +135,7 @@ public class EliminateLoopsHelper { statLabeled.put(st.id, LowBreakHelper.isBreakEdgeLabeled(lstBreakEdges.get(i).getSource(), st) | statLabeled.get(st.id)); } - int postcount = 0; - for (Boolean val : statLabeled.values()) { - postcount += val ? 1 : 0; - } + int postcount = statLabeled.values().stream().mapToInt(val -> val ? 1 : 0).sum(); if (precount <= postcount) { return false; diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java b/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java index 12840f2..9ab65e0 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -172,15 +172,13 @@ public class IrreducibleCFGDeobfuscator { private static int getStatementSize(Statement statement) { - int res = 0; + int res; if (statement.type == Statement.TYPE_BASICBLOCK) { res = ((BasicBlockStatement)statement).getBlock().getSeq().length(); } else { - for (Statement stat : statement.getStats()) { - res += getStatementSize(stat); - } + res = statement.getStats().stream().mapToInt(IrreducibleCFGDeobfuscator::getStatementSize).sum(); } return res;