Get rid of QByteArray in djbStringHash

This commit is contained in:
Ilya Fedin 2021-03-07 09:51:21 +04:00 committed by John Preston
parent 817610ddd7
commit cc736158a6
1 changed files with 2 additions and 3 deletions

View File

@ -469,9 +469,8 @@ bool IsSNIAvailable() {
uint djbStringHash(const std::string &string) {
uint hash = 5381;
const auto chars = QByteArray::fromStdString(string.data());
for(int i = 0; i < chars.length(); i++){
hash = (hash << 5) + hash + chars[i];
for (const auto &curChar : string) {
hash = (hash << 5) + hash + curChar;
}
return hash;
}