diff options
author | Marius Ungureanu <therzok@gmail.com> | 2018-03-26 20:22:31 +0300 |
---|---|---|
committer | Marius Ungureanu <teromario@yahoo.com> | 2018-04-17 14:13:26 +0300 |
commit | eaac6d0622b43f12867d9a9e7251502f419b0b1e (patch) | |
tree | 33d04eb88731a4a3d21021995dc496baef7de1a2 /main/src/core | |
parent | c69f43395b832952a6299e86755e29d6a2e0e722 (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.cs | 3 |
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) { |