File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
GeneralsMD/Code/GameEngine/Include/Common
Generals/Code/GameEngine/Include/Common Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -190,10 +190,16 @@ namespace rts
190190
191191 template <> struct hash <AsciiString>
192192 {
193- size_t operator ()(AsciiString ast) const
194- {
193+ size_t operator ()(const AsciiString& ast) const
194+ {
195+ #ifdef USING_STLPORT
195196 std::hash<const char *> tmp;
196197 return tmp ((const char *) ast.str ());
198+ #else
199+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
200+ std::hash<std::string_view> hasher;
201+ return hasher (std::string_view (ast.str (), ast.getLength ()));
202+ #endif
197203 }
198204 };
199205
Original file line number Diff line number Diff line change @@ -190,10 +190,16 @@ namespace rts
190190
191191 template <> struct hash <AsciiString>
192192 {
193- size_t operator ()(AsciiString ast) const
194- {
193+ size_t operator ()(const AsciiString& ast) const
194+ {
195+ #ifdef USING_STLPORT
195196 std::hash<const char *> tmp;
196197 return tmp ((const char *) ast.str ());
198+ #else
199+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
200+ std::hash<std::string_view> hasher;
201+ return hasher (std::string_view (ast.str (), ast.getLength ()));
202+ #endif
197203 }
198204 };
199205
You can’t perform that action at this time.
0 commit comments