mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-28 10:32:34 -04:00
Temp commit to record attempts. Stream APIs are implemented and working. Added some new test cases based on deployed Kavita server testing.
This commit is contained in:
@@ -2,15 +2,26 @@
|
||||
|
||||
namespace API.Comparators
|
||||
{
|
||||
public class ChapterSortComparer : IComparer<int>
|
||||
public class ChapterSortComparer : IComparer<float>
|
||||
{
|
||||
public int Compare(int x, int y)
|
||||
// public int Compare(int x, int y)
|
||||
// {
|
||||
// if (x == 0 && y == 0) return 0;
|
||||
// // if x is 0, it comes second
|
||||
// if (x == 0) return 1;
|
||||
// // if y is 0, it comes second
|
||||
// if (y == 0) return -1;
|
||||
//
|
||||
// return x.CompareTo(y);
|
||||
// }
|
||||
|
||||
public int Compare(float x, float y)
|
||||
{
|
||||
if (x == 0 && y == 0) return 0;
|
||||
if (x == 0.0 && y == 0.0) return 0;
|
||||
// if x is 0, it comes second
|
||||
if (x == 0) return 1;
|
||||
if (x == 0.0) return 1;
|
||||
// if y is 0, it comes second
|
||||
if (y == 0) return -1;
|
||||
if (y == 0.0) return -1;
|
||||
|
||||
return x.CompareTo(y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user