AutoMerge.BranchesViewModel.GetTargetPath C# (CSharp) Метод

GetTargetPath() приватный статический Метод

private static GetTargetPath ( ICollection mergesRelationships, ItemIdentifier targetBranch ) : ItemIdentifier
mergesRelationships ICollection
targetBranch ItemIdentifier
Результат ItemIdentifier
        private static ItemIdentifier GetTargetPath(ICollection<ItemIdentifier> mergesRelationships, ItemIdentifier targetBranch)
        {
            if (mergesRelationships == null || mergesRelationships.Count == 0)
                return null;
            var targetItem = mergesRelationships.FirstOrDefault(m => IsTargetPath(m, targetBranch));
            if (targetItem != null)
            {
                mergesRelationships.Remove(targetItem);
                return targetItem;
            }

            return null;
        }