diff options
author | Marius Ungureanu <teromario@yahoo.com> | 2017-02-16 15:09:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-16 15:09:34 +0300 |
commit | 9b3cd898a4336a196d2123930b2375b364da6c7d (patch) | |
tree | 0ab5875757dfae7477e98ecadfc4fd579cf76cf4 /main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs | |
parent | 642cfa4ca9708564f34f27f441710cde27bb3abc (diff) |
String optimizations (#1881)
* [Core] Remove ToLower where applicable.
* [Core] Remove ToUpper where applicable.
* [View] Fix possible crash in no selection tolower/toupper
Instead of getting just 1 char, we get a possible huge string, depending on the caret's offset in a document.
* [Ide] Fix lots of intermediate strings being created on keybindings panel filtering
* [Ide] Remove string.ToLower where applicable.
* [Ide] Remove string.ToUpper where applicable.
* [Editor] Remove string.ToLower where applicable.
* [Addins] Remove string.ToLower string.ToUpper where applicable.
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs index 0f3cf003aa..64c02aa332 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs @@ -184,7 +184,7 @@ namespace MonoDevelop.Projects ProjectConfiguration config = (ProjectConfiguration) GetConfiguration (configuration); if (config == null) return false; - if (FileName.Extension.ToLower () != ".exe") + if (!string.Equals (FileName.Extension, ".exe", StringComparison.OrdinalIgnoreCase)) return false; ExecutionCommand cmd = CreateExecutionCommand (configuration, config); return context.ExecutionHandler.CanExecute (cmd); @@ -210,7 +210,8 @@ namespace MonoDevelop.Projects { public override bool CanRead (FilePath file, Type expectedType) { - return expectedType.IsAssignableFrom (typeof(SolutionItem)) && (file.Extension.ToLower() == ".exe" || file.Extension.ToLower() == ".dll"); + return expectedType.IsAssignableFrom (typeof(SolutionItem)) && + (string.Equals (file.Extension, ".exe", StringComparison.OrdinalIgnoreCase) || string.Equals (file.Extension, ".dll", StringComparison.OrdinalIgnoreCase)); } public override Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid) |