* Make mac/win lookups lowercase'd * Revert #709 & 81042cc * Adjust HashPolicy implementation across sourcemod Basically, in order to implement our own (actual) hash policy in `PluginSys.h`, we needed to remove the blanket implementation of `hash` that was used before. Now, each policy must implement `hash` along with `matches` in order to be used with `NameHashSet`. While this does force us to change every implementation of policies across the entirety of sourcemod, it allows core to use flexible implementations of `hash`. * Remove logic duplication * Improve lowercase checks
This commit is contained in:
committed by
Nicholas Hastings
parent
daee19d502
commit
aaac0b9eb2
@@ -43,6 +43,7 @@
|
||||
#include <compat_wrappers.h>
|
||||
#include "concmd_cleaner.h"
|
||||
#include "PlayerManager.h"
|
||||
#include <sm_stringhashmap.h>
|
||||
|
||||
using namespace SourceHook;
|
||||
|
||||
@@ -67,6 +68,10 @@ struct ConVarInfo
|
||||
{
|
||||
return strcmp(name, info->pVar->GetName()) == 0;
|
||||
}
|
||||
static inline uint32_t hash(const detail::CharsAndLength &key)
|
||||
{
|
||||
return key.hash();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user