/// <summary> /// Enumerates all the hashes with <see cref="ContentLocationEntry"/> from a <paramref name="database"/> for a given <paramref name="currentMachineId"/>. /// </summary> public static IEnumerable <(ShortHash hash, ContentLocationEntry entry)> EnumerateSortedDatabaseEntriesForMachineId( this ContentLocationDatabase database, OperationContext context, MachineId currentMachineId) { foreach (var(key, entry) in database.EnumerateEntriesWithSortedKeys( context.Token, rawValue => database.HasMachineId(rawValue, currentMachineId.Index))) { yield return(key, entry); } }
/// <summary> /// Enumerates all the hashes with <see cref="ContentLocationEntry"/> from a <paramref name="database"/> for a given <paramref name="currentMachineId"/>. /// </summary> private static IEnumerable <(ShortHash hash, ContentLocationEntry entry)> EnumerateSortedDatabaseEntriesForMachineId( this ContentLocationDatabase database, OperationContext context, MachineId currentMachineId, ShortHash?startingPoint) { var filter = new ContentLocationDatabase.EnumerationFilter( rawValue => database.HasMachineId(rawValue, currentMachineId.Index), startingPoint); foreach (var(key, entry) in database.EnumerateEntriesWithSortedKeys(context, filter)) { yield return(key, entry); } }