Skip to content

Commit

Permalink
fix group by date issue #7
Browse files Browse the repository at this point in the history
Sort commits before grouping by date. Only incur the sort cost
for sorting by date.
  • Loading branch information
corytodd committed Aug 24, 2021
1 parent b2f6cac commit aefd9aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Walrus.Core/WalrusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public IEnumerable<CommitGroup> ExecuteQuery(WalrusQuery query)
g.OrderBy(c => c.Timestamp))),

WalrusQuery.QueryGrouping.Date => commits
.OrderBy(c => c.Timestamp)
.GroupBy(c => c.Timestamp.Date)
.Select(g => new CommitGroup(g.Key,
g.OrderBy(c => c.Timestamp))),
Expand Down

0 comments on commit aefd9aa

Please sign in to comment.