diff options
author | Therzok <teromario@yahoo.com> | 2013-09-24 12:32:31 +0400 |
---|---|---|
committer | Therzok <teromario@yahoo.com> | 2013-09-24 12:32:31 +0400 |
commit | 52d3890336a3be8c2c09464ceda8cb88a993e5ff (patch) | |
tree | 0a7c7874ea0b8fc05bfb16d8e8f0b6c969014a27 /main/src/tools | |
parent | ef9df7b8f1d6eb2799155e0919fed16c2a27e5c1 (diff) |
[Optimization] Replace O(N) operation with O(1).
Diffstat (limited to 'main/src/tools')
-rw-r--r-- | main/src/tools/mdmonitor/TimeLineView.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/tools/mdmonitor/TimeLineView.cs b/main/src/tools/mdmonitor/TimeLineView.cs index 84df68518f..cac59f3169 100644 --- a/main/src/tools/mdmonitor/TimeLineView.cs +++ b/main/src/tools/mdmonitor/TimeLineView.cs @@ -182,7 +182,7 @@ namespace Mono.Instrumentation.Monitor void FillTimerTraces (IEnumerable<TimerTrace> traces, List<CounterValueInfo> list, DateTime startTime, DateTime endTime) { - if (traces.Count () == 0) { + if (!traces.Any ()) { GetValues (list, startTime, endTime, false, false); } else { GetValues (list, startTime, traces.First ().Timestamp, false, false); @@ -268,7 +268,7 @@ namespace Mono.Instrumentation.Monitor i++; } list.RemoveRange (n + 1, i - n - 1); - val.CanExpand = (i > n + 1) || (val.TimerTraces.Count() > 0); + val.CanExpand = (i > n + 1) || (val.TimerTraces.Any ()); } else val.Duration = list [n + 1].Time - val.Time; } |