Skip to content

Commit

Permalink
Don't clone context in ApplyStaticFields (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmascitelli authored Dec 20, 2023
1 parent 5d02641 commit 4838030
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Unleash/UnleashContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ public string GetByName(string contextName)

public UnleashContext ApplyStaticFields(UnleashSettings settings)
{
var environment = string.IsNullOrEmpty(Environment) ? settings.Environment : Environment;
var appName = string.IsNullOrEmpty(AppName) ? settings.AppName : AppName;

return new UnleashContext(appName, environment, UserId, SessionId, RemoteAddress, CurrentTime, new Dictionary<string, string>(Properties));
Environment = string.IsNullOrEmpty(Environment) ? settings.Environment : Environment;
AppName = string.IsNullOrEmpty(AppName) ? settings.AppName : AppName;
return this;
}

internal static Builder New()
Expand Down

0 comments on commit 4838030

Please sign in to comment.