Skip to content

Commit

Permalink
Better null checking for options inbuilder (1 less check in happy path)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodydonetti committed Apr 20, 2024
1 parent 2857b37 commit a79aa82
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ public IFusionCache Build(IServiceProvider serviceProvider)
}
}

options ??= Options;

if (options is null)
{
options = new FusionCacheOptions()
options = Options;

if (options is null)
{
CacheName = CacheName
};
options = new FusionCacheOptions()
{
CacheName = CacheName
};
}
}

SetupOptionsAction?.Invoke(options);
Expand Down

0 comments on commit a79aa82

Please sign in to comment.