This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -194,9 +194,7 @@ if (!is(T == enum) && __traits(isStaticArray, T) && !canBitwiseHash!T)
194194
195195// dynamic array hash
196196size_t hashOf (T)(scope const T val, size_t seed = 0 )
197- if (! is (T == enum ) && ! is (T : typeof (null )) && is (T S: S[]) && ! __traits(isStaticArray, T)
198- && ! is (T == struct ) && ! is (T == class ) && ! is (T == union )
199- && (__traits(isScalar, S) || canBitwiseHash! S))
197+ if (is (T == S[], S) && (__traits(isScalar, S) || canBitwiseHash! S)) // excludes enum types
200198{
201199 alias ElementType = typeof (val[0 ]);
202200 static if (! canBitwiseHash! ElementType)
@@ -222,9 +220,7 @@ if (!is(T == enum) && !is(T : typeof(null)) && is(T S: S[]) && !__traits(isStati
222220
223221// dynamic array hash
224222size_t hashOf (T)(T val, size_t seed = 0 )
225- if (! is (T == enum ) && ! is (T : typeof (null )) && is (T S: S[]) && ! __traits(isStaticArray, T)
226- && ! is (T == struct ) && ! is (T == class ) && ! is (T == union )
227- && ! (__traits(isScalar, S) || canBitwiseHash! S))
223+ if (is (T == S[], S) && ! (__traits(isScalar, S) || canBitwiseHash! S)) // excludes enum types
228224{
229225 size_t hash = seed;
230226 foreach (ref o; val)
You can’t perform that action at this time.
0 commit comments