Skip to content

Commit a2e2404

Browse files
CR: Tweak delegate caching
1 parent dd79d72 commit a2e2404

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Components/Components/src/Auth/AuthorizeRouteView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public AuthorizeRouteView()
3636
// Cache the rendering delegates so that we only construct new closure instances
3737
// when they are actually used (e.g., we never prepare a RenderFragment bound to
3838
// the NotAuthorized content except when you are displaying that particular state)
39-
var renderBaseRouteViewDelegate = (RenderFragment)base.Render;
39+
RenderFragment renderBaseRouteViewDelegate = builder => base.Render(builder);
4040
_renderAuthorizedDelegate = authenticateState => renderBaseRouteViewDelegate;
4141
_renderNotAuthorizedDelegate = authenticationState => builder => RenderNotAuthorizedInDefaultLayout(builder, authenticationState);
4242
_renderAuthorizingDelegate = RenderAuthorizingInDefaultLayout;

0 commit comments

Comments
 (0)