Removed a dead variable when cloning arrays

git-svn-id: file:///srv/devel/repo-conversion/nusu@242 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2012-02-08 12:47:35 +00:00
parent cd6cec42d3
commit 91da3679a8
6 changed files with 482 additions and 558 deletions

View File

@ -61,7 +61,6 @@
<DependentUpon>AffineThreadPool.cs</DependentUpon>
</Compile>
<Compile Include="Source\Cloning\CloneFactoryTest.cs" />
<Compile Include="Source\Cloning\CloningParameters.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.FieldBased.cs">
<DependentUpon>ExpressionTreeCloner.cs</DependentUpon>

View File

@ -92,7 +92,6 @@
<DependentUpon>AffineThreadPool.cs</DependentUpon>
</Compile>
<Compile Include="Source\Cloning\CloneFactoryTest.cs" />
<Compile Include="Source\Cloning\CloningParameters.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.FieldBased.cs">
<DependentUpon>ExpressionTreeCloner.cs</DependentUpon>

View File

@ -103,7 +103,6 @@
<DependentUpon>AffineThreadPool.cs</DependentUpon>
</Compile>
<Compile Include="Source\Cloning\CloneFactoryTest.cs" />
<Compile Include="Source\Cloning\CloningParameters.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.cs" />
<Compile Include="Source\Cloning\ExpressionTreeCloner.FieldBased.cs">
<DependentUpon>ExpressionTreeCloner.cs</DependentUpon>

View File

@ -1,65 +0,0 @@
#region CPL License
/*
Nuclex Framework
Copyright (C) 2002-2010 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#endregion
using System;
namespace Nuclex.Support.Cloning {
/// <summary>Parameters of a cloning operation</summary>
public struct CloningParameters {
/// <summary>Initializes new cloning parameters</summary>
/// <param name="type">Type that will be cloned</param>
/// <param name="deep">Whether to perform a deep clone</param>
public CloningParameters(Type type, bool deep) {
this.Type = type;
this.Deep = deep;
}
/// <summary>Returns a string description of the instance</summary>
/// <returns>The instance's string description</returns>
public override string ToString() {
if(this.Deep) {
return "Deep clone of " + this.Type.ToString();
} else {
return "Shallow clone of " + this.Type.ToString();
}
}
/// <summary>
/// Returns a hash code that is identical for instances with identical state
/// </summary>
/// <returns>The instance's hash code</returns>
public override int GetHashCode() {
if(this.Deep) {
return this.Type.GetHashCode();
} else {
return ~this.Type.GetHashCode();
}
}
/// <summary>Type that will be cloned</summary>
public Type Type;
/// <summary>Whether a deep clone will be performed</summary>
public bool Deep;
}
} // namespace Nuclex.Support.Cloning

View File

@ -21,7 +21,6 @@ License along with this library
#if !(XBOX360 || WINDOWS_PHONE)
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
@ -281,10 +280,6 @@ namespace Nuclex.Support.Cloning {
Expression.Assign(indexes[0], Expression.Constant(0))
);
// We use a temporary variable to store the element
ParameterExpression element = Expression.Variable(elementType);
variables.Add(element);
// Build the nested loops (one for each dimension) from the inside out
Expression innerLoop = null;
for(int index = dimensionCount - 1; index >= 0; --index) {

View File

@ -22,9 +22,6 @@ License along with this library
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace Nuclex.Support.Cloning {