mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 16:13:46 +08:00
Get rid of QByteArray in djbStringHash
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user