remove now redundant casts

This commit is contained in:
adelikat 2020-03-03 19:09:44 -06:00
parent d38e8a0503
commit 51dcd3db46
1 changed files with 7 additions and 14 deletions

View File

@ -620,41 +620,34 @@ namespace BizHawk.Client.Common.RamSearchEngine
case ComparisonOperator.Equal:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount == compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount == compareValue);
case ComparisonOperator.NotEqual:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount != compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount != compareValue);
case ComparisonOperator.GreaterThan:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount > compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount > compareValue);
case ComparisonOperator.GreaterThanEqual:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount >= compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount >= compareValue);
case ComparisonOperator.LessThan:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount < compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount < compareValue);
case ComparisonOperator.LessThanEqual:
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount <= compareValue)
.Cast<IMiniWatch>();
.Where(w => w.ChangeCount <= compareValue);
case ComparisonOperator.DifferentBy:
if (DifferentBy.HasValue)
{
return watchList
.Cast<IMiniWatchDetails>()
.Where(w => w.ChangeCount + DifferentBy.Value == compareValue
|| w.ChangeCount - DifferentBy.Value == compareValue)
.Cast<IMiniWatch>();
|| w.ChangeCount - DifferentBy.Value == compareValue);
}
throw new InvalidOperationException();