Removed useless keyword
Former-commit-id: f5932abe5443e25d4f1fbf3e97f4eb50627fac55
This commit is contained in:
parent
11c2f82835
commit
752cfdd8db
|
|
@ -9,24 +9,23 @@ namespace std
|
|||
template<>
|
||||
struct hash<NzString>
|
||||
{
|
||||
public:
|
||||
size_t operator()(const NzString& str) const
|
||||
size_t operator()(const NzString& str) const
|
||||
{
|
||||
// Algorithme DJB2
|
||||
// http://www.cse.yorku.ca/~oz/hash.html
|
||||
|
||||
size_t h = 5381;
|
||||
if (!str.IsEmpty())
|
||||
{
|
||||
// Algorithme DJB2
|
||||
// http://www.cse.yorku.ca/~oz/hash.html
|
||||
const char* ptr = str.GetConstBuffer();
|
||||
|
||||
size_t h = 5381;
|
||||
if (!str.IsEmpty())
|
||||
{
|
||||
const char* ptr = str.GetConstBuffer();
|
||||
|
||||
do
|
||||
h = ((h << 5) + h) + *ptr;
|
||||
while (*++ptr);
|
||||
}
|
||||
|
||||
return h;
|
||||
do
|
||||
h = ((h << 5) + h) + *ptr;
|
||||
while (*++ptr);
|
||||
}
|
||||
|
||||
return h;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue