本文整理汇总了C#中System.Collections.SortedSet.Where方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.Where方法的具体用法?C# SortedSet.Where怎么用?C# SortedSet.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.SortedSet
的用法示例。
在下文中一共展示了SortedSet.Where方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckOutcomeCore
//.........这里部分代码省略.........
while (true)
{
int rem = unverified.Count;
if (rem == 0)
{
if (0 < timedOut.Count)
{
result = CheckSplit(timedOut, ref popLater, options.TimeLimit, timeLimitPerAssertion, ref queries);
if (result == Outcome.Valid)
{
timedOut.Clear();
}
else if (result == Outcome.TimeOut)
{
// Give up and report which assertions were not verified.
var cmds = timedOut.Select(id => ctx.TimeoutDiagnosticIDToAssertion[id]);
if (cmds.Any())
{
handler.OnResourceExceeded("timeout after running diagnostics", cmds);
}
}
}
else
{
result = Outcome.Valid;
}
break;
}
// TODO(wuestholz): Try out different ways for splitting up the work (e.g., randomly).
var cnt = Math.Max(1, rem / frac);
// It seems like assertions later in the control flow have smaller indexes.
var split = new SortedSet<int>(unverified.Where((val, idx) => (rem - idx - 1) < cnt));
Contract.Assert(0 < split.Count);
var splitRes = CheckSplit(split, ref popLater, timeLimitPerAssertion, timeLimitPerAssertion, ref queries);
if (splitRes == Outcome.Valid)
{
unverified.ExceptWith(split);
frac = 1;
}
else if (splitRes == Outcome.Invalid)
{
result = splitRes;
break;
}
else if (splitRes == Outcome.TimeOut)
{
if (2 <= frac && (4 <= (rem / frac)))
{
frac *= 4;
}
else if (2 <= (rem / frac))
{
frac *= 2;
}
else
{
timedOut.UnionWith(split);
unverified.ExceptWith(split);
frac = 1;
}
}
else
{
break;