]> git.lizzy.rs Git - irrlicht.git/commitdiff
Remove irr::core::hash
authorDesour <vorunbekannt75@web.de>
Tue, 21 Feb 2023 18:29:32 +0000 (19:29 +0100)
committersfan5 <sfan5@live.de>
Wed, 22 Feb 2023 10:43:42 +0000 (11:43 +0100)
Its use of std::unary_function was deprecated.
And it wasn't used anywhere.

include/irrUString.h

index 5b2b85782c65aa57b6be5e8c3f736684bf180c33..8e553fd747fc123c03e149f7ea3808bd757c578b 100644 (file)
@@ -3612,33 +3612,5 @@ inline std::wostream& operator<<(std::wostream& out, const ustring16& in)
        return out;
 }
 
-namespace unicode
-{
-
-//! Hashing algorithm for hashing a ustring.  Used for things like unordered_maps.
-//! Algorithm taken from std::hash<std::string>.
-class hash : public std::unary_function<core::ustring, size_t>
-{
-       public:
-               size_t operator()(const core::ustring& s) const
-               {
-                       size_t ret = 2166136261U;
-                       size_t index = 0;
-                       size_t stride = 1 + s.size_raw() / 10;
-
-                       core::ustring::const_iterator i = s.begin();
-                       while (i != s.end())
-                       {
-                               // TODO: Don't force u32 on an x64 OS.  Make it agnostic.
-                               ret = 16777619U * ret ^ (size_t)s[(u32)index];
-                               index += stride;
-                               i += stride;
-                       }
-                       return (ret);
-               }
-};
-
-} // end namespace unicode
-
 } // end namespace core
 } // end namespace irr