Skip to content

Cache expensive lookup that never changes over life of vs.#51943

Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:cacheComponentModel
Mar 18, 2021
Merged

Cache expensive lookup that never changes over life of vs.#51943
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:cacheComponentModel

Conversation

@CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 17, 2021 21:05
@ghost ghost added the Area-IDE label Mar 17, 2021
Comment on lines +111 to +114
if (_componentModel_doNotAccessDirectly == null)
_componentModel_doNotAccessDirectly = (IComponentModel)GetService(typeof(SComponentModel));

return _componentModel_doNotAccessDirectly;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (_componentModel_doNotAccessDirectly == null)
_componentModel_doNotAccessDirectly = (IComponentModel)GetService(typeof(SComponentModel));
return _componentModel_doNotAccessDirectly;
return _componentModel_doNotAccessDirectly ??= (IComponentModel)GetService(typeof(SComponentModel));

@CyrusNajmabadi CyrusNajmabadi merged commit 99861b0 into dotnet:main Mar 18, 2021
@ghost ghost added this to the Next milestone Mar 18, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the cacheComponentModel branch March 18, 2021 08:59
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants