Use helper prop in `InputRoll`, simplifying LINQ call
This commit is contained in:
parent
485cafadff
commit
967ce66e9e
|
@ -952,7 +952,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
private IEnumerable<int> SelectedRowsWithDuplicates
|
private IEnumerable<int> SelectedRowsWithDuplicates
|
||||||
=> _selectedItems.Where(static cell => cell.RowIndex is not null).Select(static cell => cell.RowIndex.Value);
|
=> _selectedItems.Select(static cell => cell.RowIndex ?? -1).Where(static i => i >= 0);
|
||||||
|
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
@ -1168,13 +1168,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (!selected)
|
if (!selected)
|
||||||
{
|
{
|
||||||
var rowIndices = _selectedItems
|
var rowIndices = SelectedRows.ToList();
|
||||||
.Where(c => c.RowIndex.HasValue)
|
|
||||||
.Select(c => c.RowIndex ?? -1)
|
|
||||||
.Where(c => c >= 0) // Hack to avoid possible Nullable exceptions
|
|
||||||
.Distinct()
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var firstIndex = rowIndices.Min();
|
var firstIndex = rowIndices.Min();
|
||||||
var lastIndex = rowIndices.Max();
|
var lastIndex = rowIndices.Max();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue