使用std::hash进行哈希算法优化
This commit is contained in:
		
							parent
							
								
									95392c19c3
								
							
						
					
					
						commit
						cfca0d1cea
					
				|  | @ -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<std::wstring> hash; | ||||
| 	return hash(_str); | ||||
| } | ||||
| 
 | ||||
| std::wstring e2d::String::getWString() const | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue