From 6c33857abfca7e931ba6d81c0e1aa11b4b8d45a7 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Sun, 6 May 2012 17:20:06 -0700 Subject: [PATCH] Use ArrayDeque instead of LinkedList. --- .../cdt/internal/core/pdom/PDOMManager.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java index 2848f3fc7c8..f4f0219f14c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java @@ -20,11 +20,11 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; @@ -139,17 +139,17 @@ public class PDOMManager implements IWritableIndexManager, IListener { ILinkage.C_LINKAGE_ID, ILinkage.CPP_LINKAGE_ID, ILinkage.FORTRAN_LINKAGE_ID }; - private final LinkedList fProjectQueue= new LinkedList(); + private final ArrayDeque fProjectQueue= new ArrayDeque(); private final PDOMSetupJob fSetupJob; /** * Protects fIndexerJob, fCurrentTask and fTaskQueue. */ - private final LinkedList fTaskQueue = new LinkedList(); + private final ArrayDeque fTaskQueue = new ArrayDeque(); private final PDOMIndexerJob fIndexerJob; private IPDOMIndexerTask fCurrentTask; private int fSourceCount, fHeaderCount, fTickCount; - private final LinkedList fChangeEvents= new LinkedList(); + private final ArrayDeque fChangeEvents= new ArrayDeque(); private final Job fNotificationJob; private final AtomicMultiSet fFilesIndexedUnconditionlly= new AtomicMultiSet(); @@ -1513,10 +1513,10 @@ public class PDOMManager implements IWritableIndexManager, IListener { IIndex index= getIndex(cproject); index.acquireReadLock(); try { - for(ITranslationUnit tu : sources) { + for (ITranslationUnit tu : sources) { IResource resource= tu.getResource(); if (resource instanceof IFile && isSubjectToIndexing(tu.getLanguage())) { - IIndexFileLocation location= IndexLocationFactory.getWorkspaceIFL((IFile)resource); + IIndexFileLocation location= IndexLocationFactory.getWorkspaceIFL((IFile) resource); if (!areSynchronized(new HashSet(), index, resource, location)) { return false; } @@ -1566,7 +1566,7 @@ public class PDOMManager implements IWritableIndexManager, IListener { // if it is up-to-date, the includes have not changed and may // be read from the index. IIndexInclude[] includes= index.findIncludes(file[0]); - for(IIndexInclude inc : includes) { + for (IIndexInclude inc : includes) { IIndexFileLocation newLocation= inc.getIncludesLocation(); if (newLocation != null) { String path= newLocation.getFullPath();