When migrating our code to .NET6 we altered our code to get it to compile:
var query =
from eis in _metaData.EmployeeInShift.WhereIn(x => x.Id, employeesToCallUp.Select(y => y.EmployeeInShiftId))
where eis.EmpInShiftContractTypeId == (long)EmpInShiftContractType.Gig
orderby eis.Id
select eis.Id;
var lookup = query.ToArray();
var nonCallUpList = new List<EmployeeCallUpData>();
var callUpList = new List<EmployeeCallUpData>();
foreach (var item in employeesToCallUp)
{
if (lookup.BinarySearch(item.EmployeeInShiftId, Comparer<long>.Default) != -1)
nonCallUpList.Add(item);
else
callUpList.Add(item);
}
we changed this line:
if (lookup.BinarySearch(item.EmployeeInShiftId, Comparer<long>.Default) != -1)
to
if (SDBinarySearch.BinarySearch(lookup, item.EmployeeInShiftId, Comparer<long>.Default) != -1)
Are these lines functionally equivalent i.e. can they be interchanged without altering the functionality?