This project is read-only.

Bad sorting by UId on Search

Aug 4, 2014 at 7:35 AM
Edited Aug 4, 2014 at 7:58 AM
Hi.

Folder.cs: 464
internal long[] SearchMessageIds(string query = "ALL", int count = -1)
        {
            ...
            return count < 0
                ? result.Groups[1].Value.Trim().Split(' ').Select(long.Parse).ToArray()
                : result.Groups[1].Value.Trim().Split(' ').OrderByDescending(_ => _).Take(count).Select(long.Parse).ToArray();
        }
Sorting as String! As a result, UId 9999 is earlier UId 10001.

Solve:
return count < 0
                ? result.Groups[1].Value.Trim().Split(' ').Select(long.Parse).ToArray()
                : result.Groups[1].Value.Trim().Split(' ').OrderByDescending(long.Parse).Take(count).Select(long.Parse).ToArray();
Aug 5, 2014 at 8:12 PM
Hi IliaV,

thank you for the hint, you can check the latest code in the repository, the issue is fixed now.

Greets,

Pavel