File tree 2 files changed +15
-3
lines changed
Generals/Code/GameEngine/Include/Common
GeneralsMD/Code/GameEngine/Include/Common
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -204,10 +204,16 @@ namespace rts
204
204
205
205
template <> struct hash <AsciiString>
206
206
{
207
- size_t operator ()(AsciiString ast) const
207
+ size_t operator ()(const AsciiString& ast) const
208
208
{
209
+ #ifdef USING_STLPORT
209
210
std::hash<const char *> tmp;
210
211
return tmp ((const char *) ast.str ());
212
+ #else
213
+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
214
+ std::hash<std::string_view> hasher;
215
+ return hasher (std::string_view (ast.str (), ast.getLength ()));
216
+ #endif
211
217
}
212
218
};
213
219
Original file line number Diff line number Diff line change @@ -204,10 +204,16 @@ namespace rts
204
204
205
205
template <> struct hash <AsciiString>
206
206
{
207
- size_t operator ()(AsciiString ast) const
208
- {
207
+ size_t operator ()(const AsciiString& ast) const
208
+ {
209
+ #ifdef USING_STLPORT
209
210
std::hash<const char *> tmp;
210
211
return tmp ((const char *) ast.str ());
212
+ #else
213
+ // TheSuperHackers @bugfix xezon 16/03/2024 Re-implements hash function that works with non-STLPort.
214
+ std::hash<std::string_view> hasher;
215
+ return hasher (std::string_view (ast.str (), ast.getLength ()));
216
+ #endif
211
217
}
212
218
};
213
219
You can’t perform that action at this time.
0 commit comments