From f35ae8f635d26a195a852c0d77f3ce00d9096b63 Mon Sep 17 00:00:00 2001 From: Lyle Davis Date: Tue, 13 Oct 2020 02:23:00 +0100 Subject: [PATCH] remove duplication --- src/Chainz/Chain.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Chainz/Chain.cs b/src/Chainz/Chain.cs index 5365ed3..0f68c11 100644 --- a/src/Chainz/Chain.cs +++ b/src/Chainz/Chain.cs @@ -35,8 +35,7 @@ public Chain Use() where TChainLink : IChainLink /// Returns self for fluid interface public Chain Prepend() where TChainLink : IChainLink { - InsertAt(0); - return this; + return InsertAt(0); } /// @@ -50,8 +49,7 @@ public Chain After() where TChainLinkToInsert : IChainLink { var index = _links.IndexOf(typeof(TPreviousChainLink)) + 1; - _links.Insert(index, typeof(TChainLinkToInsert)); - return this; + return InsertAt(index); } /// @@ -65,8 +63,7 @@ public Chain Before() where TChainLinkToInsert : IChainLink { var index = _links.IndexOf(typeof(TNextChainLink)); - _links.Insert(index, typeof(TChainLinkToInsert)); - return this; + return InsertAt(index); } ///