Beispiel #1
0
 /// <summary>This constructor is for cloning purposes.</summary>
 /// <param name="set">The set to clone.</param>
 /// <param name="clone">A delegate for cloning the structures.</param>
 /// <runtime>O(n)</runtime>
 internal Set(Set <Structure, T> set, StructureClone clone)
 {
     _factory = set._factory;
     _equate  = set._equate;
     _hash    = set._hash;
     _table   = new Structure[set._table.Length];
     for (int i = 0; i < _table.Length; i++)
     {
         if (!(set._table[i] is null))
         {
             _table[i] = clone(set._table[i]);
         }
     }
     _count = set._count;
 }
Beispiel #2
0
 /// <summary>Creates a shallow clone of this set.</summary>
 /// <returns>A shallow clone of this set.</returns>
 /// <runtime>Θ(n)</runtime>
 public Set <Structure, T> Clone(StructureClone clone) => new Set <Structure, T>(this, clone);