From 752cfdd8db9ad2076363eb68c58bba2f038f1729 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 30 Mar 2014 19:17:32 +0200 Subject: [PATCH] Removed useless keyword Former-commit-id: f5932abe5443e25d4f1fbf3e97f4eb50627fac55 --- include/Nazara/Core/String.inl | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/include/Nazara/Core/String.inl b/include/Nazara/Core/String.inl index fbbb7c932..ac922d99b 100644 --- a/include/Nazara/Core/String.inl +++ b/include/Nazara/Core/String.inl @@ -9,24 +9,23 @@ namespace std template<> struct hash { - 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; + } }; }