[PERF] Remove extra ModelStateDictionary allocations
The copy constructor is chaining to the wrong constructor. This results in an extra 8 allocations of ModelStateDictionary per-request. All of the various filter contexts inherit from ActionContext, that's how you get the 8 extras. Small problem but easy fix.
This commit is contained in:
parent
054b46c1cc
commit
cfd9bfe13b
|
|
@ -29,9 +29,12 @@ namespace Microsoft.AspNet.Mvc
|
|||
/// </summary>
|
||||
/// <param name="actionContext">The <see cref="ActionContext"/> to copy.</param>
|
||||
public ActionContext([NotNull] ActionContext actionContext)
|
||||
: this(actionContext.HttpContext, actionContext.RouteData, actionContext.ActionDescriptor)
|
||||
: this(
|
||||
actionContext.HttpContext,
|
||||
actionContext.RouteData,
|
||||
actionContext.ActionDescriptor,
|
||||
actionContext.ModelState)
|
||||
{
|
||||
ModelState = actionContext.ModelState;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue