[NTOS:CM] Implement COMPUTE_HASH_CHAR macro definition

Wrap the hash computation formula in a macro so that we don't have to copy
the logic over the places again and again.
This commit is contained in:
George Bișoc 2023-08-28 19:37:00 +02:00
parent a4213d491d
commit 26fe3616fe
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -12,6 +12,12 @@
#define GET_HASH_KEY(ConvKey) \
((CMP_HASH_IRRATIONAL * (ConvKey)) % CMP_HASH_PRIME)
//
// Computes the hashkey of a character
//
#define COMPUTE_HASH_CHAR(ConvKey, Char) \
(37 * ConvKey + RtlUpcaseUnicodeChar(Char))
//
// Returns the index into the hash table, or the entry itself
//