From cfca0d1cead980617309992dfdd4cc977717418e Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Sun, 8 Jul 2018 15:31:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8std::hash=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=93=88=E5=B8=8C=E7=AE=97=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/Common/String.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/Common/String.cpp b/core/Common/String.cpp index 066c5c4a..a9c8ebed 100644 --- a/core/Common/String.cpp +++ b/core/Common/String.cpp @@ -359,14 +359,8 @@ int e2d::String::getLength() const unsigned int e2d::String::getHashCode() const { - unsigned int hash = 0; - - for (size_t i = 0, length = _str.size(); i < length; ++i) - { - hash *= 16777619; - hash ^= (unsigned int)towupper(_str[i]); - } - return hash; + std::hash hash; + return hash(_str); } std::wstring e2d::String::getWString() const