mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
make defaultValue readonly and edit comment
This commit is contained in:
parent
fb640b68c8
commit
7967844cf3
1 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
public class LazyAsync<T> : Lazy<ValueTask<T>>
|
||||
{
|
||||
private T defaultValue;
|
||||
private readonly T defaultValue;
|
||||
|
||||
private readonly Action _updateCallback;
|
||||
public new T Value
|
||||
|
|
@ -24,7 +24,7 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
if (!IsValueCreated)
|
||||
{
|
||||
_ = Exercute();
|
||||
_ = Exercute(); // manually use callback strategy
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
|
@ -34,8 +34,8 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
return base.Value.Result;
|
||||
|
||||
// If none of the variables captured by the local function are captured by other lambdas
|
||||
// , the compiler can avoid heap allocations.
|
||||
// If none of the variables captured by the local function are captured by other lambdas,
|
||||
// the compiler can avoid heap allocations.
|
||||
async ValueTask Exercute()
|
||||
{
|
||||
await base.Value.ConfigureAwait(false);
|
||||
|
|
|
|||
Loading…
Reference in a new issue