diff options
author | Lars Vogel | 2020-02-07 08:52:01 +0000 |
---|---|---|
committer | Lars Vogel | 2020-02-11 07:52:07 +0000 |
commit | 5ed004a04bbeed73c9e96764acbd9bc55b012d2d (patch) | |
tree | 278aec702b4ab2bf441b330be3e81f94812b88b5 /bundles | |
parent | 67c004a6dfd488bb8322bdb724cf2d3baa3ad9fb (diff) | |
download | eclipse.platform.team-5ed004a04bbeed73c9e96764acbd9bc55b012d2d.tar.gz eclipse.platform.team-5ed004a04bbeed73c9e96764acbd9bc55b012d2d.tar.xz eclipse.platform.team-5ed004a04bbeed73c9e96764acbd9bc55b012d2d.zip |
Use map method directly if possible
JDT provides a new cleanup which allows to transform code to call
methods directly on map instead of accessing the values or the keys
before calling the same method.
Saves code which we have to read and might be slightly faster.
Change-Id: If957522bcf8ad88721ac35e989695e17080b59a9
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'bundles')
5 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java index 8bfdabf26..2e22842c3 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/variants/AbstractResourceVariantTree.java @@ -193,7 +193,7 @@ public abstract class AbstractResourceVariantTree implements IResourceVariantTre monitor); } - IResource[] cleared = collectedMembers(local, children.keySet().toArray(new IResource[children.keySet().size()])); + IResource[] cleared = collectedMembers(local, children.keySet().toArray(new IResource[children.size()])); changedResources.addAll(Arrays.asList(cleared)); monitor.worked(1); } diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java index e837d78d3..9dd8b3ef1 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/LogEntryCache.java @@ -44,7 +44,7 @@ class LogEntryCache implements ILogEntryListener { */ public ILogEntry[] getLogEntries(String path) { Map map = internalGetLogEntries(path); - return (ILogEntry[]) map.values().toArray(new ILogEntry[map.values().size()]); + return (ILogEntry[]) map.values().toArray(new ILogEntry[map.size()]); } ILogEntry internalGetLogEntry(String path, String revision) { diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java index 521acc8b0..2e5f4979b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/RemoteLogOperation.java @@ -66,7 +66,7 @@ public class RemoteLogOperation extends RepositoryLocationOperation { */ public ILogEntry[] getLogEntries(String path) { Map<String, ILogEntry> map = internalGetLogEntries(path); - return map.values().toArray(new ILogEntry[map.values().size()]); + return map.values().toArray(new ILogEntry[map.size()]); } private ILogEntry internalGetLogEntry(String path, String revision) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java index 519332f66..7c465f864 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java @@ -459,7 +459,7 @@ public class SynchronizeManager implements ISynchronizeManager { @Override public synchronized ISynchronizeParticipantReference[] getSynchronizeParticipants() { - return participantReferences.values().toArray(new ISynchronizeParticipantReference[participantReferences.values().size()]); + return participantReferences.values().toArray(new ISynchronizeParticipantReference[participantReferences.size()]); } @Override diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java index 4f98146e8..274c19434 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java @@ -143,7 +143,7 @@ public class ProjectSetExportWizard extends Wizard implements IExportWizard { // XMLMemento xmlMemento = getXMLMementoRoot(); Iterator it = map.keySet().iterator(); - monitor.beginTask(null, 1000 * map.keySet().size()); + monitor.beginTask(null, 1000 * map.size()); while (it.hasNext()) { String id = (String)it.next(); IMemento memento = xmlMemento.createChild("provider"); //$NON-NLS-1$ |