1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Revert "Bug 398550. An attempt to make MBSLanguageSettingsProvider.getSettingEntries method faster."

This reverts commit d3a15b651c.
This commit is contained in:
Andrew Gvozdev 2013-01-19 06:41:00 -05:00
parent d3a15b651c
commit b8d75b789e

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2013 Andrew Gvozdev and others. * Copyright (c) 2009, 2011 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,9 +12,7 @@
package org.eclipse.cdt.managedbuilder.internal.language.settings.providers; package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import org.eclipse.cdt.core.AbstractExecutableExtensionBase; import org.eclipse.cdt.core.AbstractExecutableExtensionBase;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -61,7 +59,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
languageSettings = getLanguageSettings(rcDescription); languageSettings = getLanguageSettings(rcDescription);
} }
Set<ICLanguageSettingEntry> set = new LinkedHashSet<ICLanguageSettingEntry>(); List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
if (languageSettings != null) { if (languageSettings != null) {
for (ICLanguageSetting langSetting : languageSettings) { for (ICLanguageSetting langSetting : languageSettings) {
@ -88,8 +86,8 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager(); IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
String projectRootedPath = mngr.generateVariableExpression("workspace_loc", rc.getProject().getName()) + Path.SEPARATOR + pathStr; //$NON-NLS-1$ String projectRootedPath = mngr.generateVariableExpression("workspace_loc", rc.getProject().getName()) + Path.SEPARATOR + pathStr; //$NON-NLS-1$
ICLanguageSettingEntry projectRootedEntry = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, projectRootedPath, projectRootedPath, null, entry.getFlags()); ICLanguageSettingEntry projectRootedEntry = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, projectRootedPath, projectRootedPath, null, entry.getFlags());
if (!set.contains(projectRootedEntry)) { if (! list.contains(projectRootedEntry)) {
set.add(projectRootedEntry); list.add(projectRootedEntry);
} }
} }
} catch (CdtVariableException e) { } catch (CdtVariableException e) {
@ -99,8 +97,8 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
} }
} }
if (!set.contains(entry)) { if (! list.contains(entry)) {
set.add(entry); list.add(entry);
} }
} }
} }
@ -109,7 +107,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
} }
} }
} }
return LanguageSettingsStorage.getPooledList(new ArrayList<ICLanguageSettingEntry>(set)); return LanguageSettingsStorage.getPooledList(list);
} }
/** /**