From 1c0cad79c6b61b406635c6a09fad8877b8db4075 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 3 May 2017 19:28:21 +0300 Subject: [PATCH] minor optimization --- .../decompose/FastExtendedPostdominanceHelper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java index f37aedc..9a4e046 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -65,8 +65,9 @@ public class FastExtendedPostdominanceHelper { filterOnDominance(filter); - HashMap> res = new HashMap<>(); - for (Entry> entry : mapExtPostdominators.entrySet()) { + Set>> entries = mapExtPostdominators.entrySet(); + HashMap> res = new HashMap<>(entries.size()); + for (Entry> entry : entries) { res.put(entry.getKey(), entry.getValue().toPlainSet()); } @@ -173,7 +174,7 @@ public class FastExtendedPostdominanceHelper { lstPredSets.add(setPred); } - for (Integer id : setReachability.toPlainSet()) { + for (Integer id : setReachability) { FastFixedSet setReachabilityCopy = setReachability.getCopy(); @@ -245,7 +246,7 @@ public class FastExtendedPostdominanceHelper { Integer nodeid = node.id; FastFixedSet setReachability = mapSets.get(nodeid); - for (Integer id : setReachability.toPlainSet()) { + for (Integer id : setReachability) { mapExtPostdominators.get(id).add(nodeid); }