1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 21:27:54 +08:00

Rename parameter and remove redundant parentheses

This commit is contained in:
Endrik Tombak 2021-08-25 22:43:58 +03:00
parent 52a243afca
commit b484bd1af3

View File

@ -105,17 +105,17 @@ namespace osu.Game.Screens.Select.Carousel
// find nearest such item going forwards in selection // find nearest such item going forwards in selection
int forwardsDistance = 0; int forwardsDistance = 0;
var forwards = Children.Skip(lastSelectedIndex).SkipWhile((c) => var forwards = Children.Skip(lastSelectedIndex).SkipWhile(item =>
{ {
forwardsDistance++; forwardsDistance++;
return c.Filtered.Value; return item.Filtered.Value;
}).FirstOrDefault(); }).FirstOrDefault();
// and backwards // and backwards
int backwardsDistance = 0; int backwardsDistance = 0;
var backwards = Children.Reverse().Skip(InternalChildren.Count - lastSelectedIndex - 1).SkipWhile((c) => var backwards = Children.Reverse().Skip(InternalChildren.Count - lastSelectedIndex - 1).SkipWhile(item =>
{ {
backwardsDistance++; backwardsDistance++;
return c.Filtered.Value; return item.Filtered.Value;
}).FirstOrDefault(); }).FirstOrDefault();
// if only one direction had such an item, return that // if only one direction had such an item, return that