Skip to content

Commit

Permalink
Merge pull request #171 from mono/shortcut-appdomain
Browse files Browse the repository at this point in the history
Don't use AppDomain codepath for CurrentDomain
  • Loading branch information
mhutch committed Dec 6, 2023
2 parents d5fb8e6 + 145334b commit 6ec6c31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ internal void SetTemplateContentForAppDomain (string content)
TemplateProcessor CreateTemplateProcessor ()
{
var domain = host.ProvideTemplatingAppDomain (templateContentForAppDomain);
if (domain == null) {

// hosts are supposed to return null of they don't want to use a domain
// but check for CurrentDomain too so we can optimize if they do that
if (domain == null || domain == AppDomain.CurrentDomain) {
return new TemplateProcessor ();
}

Expand Down

0 comments on commit 6ec6c31

Please sign in to comment.