File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,14 @@ private static IEnumerable<IStructure<T>> GetDataStructureCandidates<T>(T[] data
151151 else if ( ds == StructureType . BinarySearch )
152152 yield return new BinarySearchStructure < T > ( props . DataType , DefaultStringComparison ) ;
153153 else if ( ds == StructureType . HashSet )
154- yield return new HashSetChainStructure < T > ( HashData . Create ( data , props . DataType , config . HashCapacityFactor ) ) ;
154+ {
155+ HashData hashData = HashData . Create ( data , props . DataType , config . HashCapacityFactor ) ;
156+
157+ if ( hashData . HashCodesPerfect )
158+ yield return new HashSetPerfectStructure < T > ( hashData ) ;
159+
160+ yield return new HashSetChainStructure < T > ( hashData ) ;
161+ }
155162 else
156163 throw new InvalidOperationException ( $ "Unsupported DataStructure { ds } ") ;
157164 }
You can’t perform that action at this time.
0 commit comments