Skip to content

Commit 1955484

Browse files
committed
Small optimizations
1 parent b190b5b commit 1955484

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

tests/TestSupport/MockBuilderContext.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,5 @@ public object ExecuteBuildUp(NamedTypeBuildKey buildKey, object existing)
163163

164164
return Strategies.ExecuteBuildUp(this);
165165
}
166-
167-
public object ExecuteTearDown(object existing)
168-
{
169-
this.BuildKey = null;
170-
this.Existing = existing;
171-
172-
Strategies.Reverse().ExecuteTearDown(this);
173-
return existing;
174-
}
175166
}
176167
}

tests/TestSupport/MockStrategyChain.cs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -102,40 +102,6 @@ public object ExecuteBuildUp(IBuilderContext builderContext)
102102
}
103103
}
104104

105-
/// <summary>
106-
/// Execute this strategy chain against the given context,
107-
/// calling the TearDown methods on the strategies.
108-
/// </summary>
109-
/// <param name="context">Context for the teardown process.</param>
110-
public void ExecuteTearDown(IBuilderContext builderContext)
111-
{
112-
var context = builderContext ?? throw new ArgumentNullException(nameof(builderContext));
113-
int i = 0;
114-
115-
try
116-
{
117-
for (; i < _strategies.Count; ++i)
118-
{
119-
if (context.BuildComplete)
120-
{
121-
--i; // Skip current strategy's post
122-
break;
123-
}
124-
_strategies[i].PreTearDown(context);
125-
}
126-
127-
for (--i; i >= 0; --i)
128-
{
129-
_strategies[i].PostTearDown(context);
130-
}
131-
}
132-
catch (Exception)
133-
{
134-
context.RecoveryStack.ExecuteRecovery();
135-
throw;
136-
}
137-
}
138-
139105
#region IEnumerable<IBuilderStrategy> Members
140106

141107
/// <summary>

0 commit comments

Comments
 (0)