Skip to content

Commit 952e937

Browse files
committed
simplify
1 parent 24b2f0b commit 952e937

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Zero-K.info/AppCode/ResourceLinkProvider.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ static bool IsSpringfilesAvailable(ResourceContentFile content, string url)
8989
return content.LinkCount > 0;
9090

9191
var md5 = content.Md5;
92-
return InflightProbes.GetOrAdd(md5, key => new Lazy<Task<bool>>(
93-
() => Task.Run(() => RunProbe(key)),
94-
LazyThreadSafetyMode.ExecutionAndPublication)).Value.Result;
92+
return InflightProbes.GetOrAdd(md5, key => new Lazy<bool>(
93+
() => RunProbe(key),
94+
LazyThreadSafetyMode.ExecutionAndPublication)).Value;
9595
}
9696

97-
// The cache re-check inside the using block covers the gap between Task completion
97+
// The cache re-check inside the using block covers the gap between Lazy completion
9898
// and InflightProbes eviction — a caller arriving in that window creates a new Lazy
9999
// but the new probe sees the just-persisted LastLinkCheck and skips the HEAD.
100100
static bool RunProbe(string md5)
@@ -121,7 +121,7 @@ static bool RunProbe(string md5)
121121
}
122122
finally
123123
{
124-
Lazy<Task<bool>> _;
124+
Lazy<bool> _;
125125
InflightProbes.TryRemove(md5, out _);
126126
}
127127
}

0 commit comments

Comments
 (0)