Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <therzok@gmail.com>2018-03-26 20:22:31 +0300
committerMarius Ungureanu <teromario@yahoo.com>2018-04-17 14:13:26 +0300
commiteaac6d0622b43f12867d9a9e7251502f419b0b1e (patch)
tree33d04eb88731a4a3d21021995dc496baef7de1a2 /main/src/core
parentc69f43395b832952a6299e86755e29d6a2e0e722 (diff)
[Ide] cache the registry service from MEF to avoid allocations in mime type finding
Diffstat (limited to 'main/src/core')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
index 137851a310..9230b16c69 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
@@ -297,10 +297,9 @@ namespace MonoDevelop.Ide.Desktop
}
}
+ static IFilePathRegistryService filePathRegistryService = CompositionManager.GetExportedValue<IFilePathRegistryService> ();
MimeTypeNode FindMimeTypeForFile (string fileName)
{
- IFilePathRegistryService filePathRegistryService = CompositionManager.GetExportedValue<IFilePathRegistryService> ();
-
try {
IContentType contentType = filePathRegistryService.GetContentTypeForPath (fileName);
if (contentType != PlatformCatalog.Instance.ContentTypeRegistryService.UnknownContentType) {