1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-10 16:51:44 +00:00
Ryujinx/Ryujinx.Profiler/UI/ProfileSorters.cs
Alex Barney b2b736abc2 Misc cleanup (#708)
* Fix typos

* Remove unneeded using statements

* Enforce var style more

* Remove redundant qualifiers

* Fix some indentation

* Disable naming warnings on files with external enum names

* Fix build

* Mass find & replace for comments with no spacing

* Standardize todo capitalization and for/if spacing
2019-07-02 04:39:22 +02:00

32 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
namespace Ryujinx.Profiler.UI
{
public static class ProfileSorters
{
public class InstantAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>>
{
public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2)
=> pair2.Value.Instant.CompareTo(pair1.Value.Instant);
}
public class AverageAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>>
{
public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2)
=> pair2.Value.AverageTime.CompareTo(pair1.Value.AverageTime);
}
public class TotalAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>>
{
public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2)
=> pair2.Value.TotalTime.CompareTo(pair1.Value.TotalTime);
}
public class TagAscending : IComparer<KeyValuePair<ProfileConfig, TimingInfo>>
{
public int Compare(KeyValuePair<ProfileConfig, TimingInfo> pair1, KeyValuePair<ProfileConfig, TimingInfo> pair2)
=> StringComparer.CurrentCulture.Compare(pair1.Key.Search, pair2.Key.Search);
}
}
}