Skip to content

Commit

Permalink
remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
LyleDavis committed Oct 13, 2020
1 parent 8f2a206 commit f35ae8f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Chainz/Chain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public Chain<TArg> Use<TChainLink>() where TChainLink : IChainLink<TArg>
/// <returns>Returns self for fluid interface</returns>
public Chain<TArg> Prepend<TChainLink>() where TChainLink : IChainLink<TArg>
{
InsertAt<TChainLink>(0);
return this;
return InsertAt<TChainLink>(0);
}

/// <summary>
Expand All @@ -50,8 +49,7 @@ public Chain<TArg> After<TPreviousChainLink, TChainLinkToInsert>()
where TChainLinkToInsert : IChainLink<TArg>
{
var index = _links.IndexOf(typeof(TPreviousChainLink)) + 1;
_links.Insert(index, typeof(TChainLinkToInsert));
return this;
return InsertAt<TChainLinkToInsert>(index);
}

/// <summary>
Expand All @@ -65,8 +63,7 @@ public Chain<TArg> Before<TNextChainLink, TChainLinkToInsert>()
where TChainLinkToInsert : IChainLink<TArg>
{
var index = _links.IndexOf(typeof(TNextChainLink));
_links.Insert(index, typeof(TChainLinkToInsert));
return this;
return InsertAt<TChainLinkToInsert>(index);
}

/// <summary>
Expand Down

0 comments on commit f35ae8f

Please sign in to comment.