Some optimization
This commit is contained in:
@ -167,6 +167,11 @@ namespace Utils
|
||||
|
||||
#pragma region JenkinsOneAtATime
|
||||
|
||||
unsigned int JenkinsOneAtATime::Compute(std::string data)
|
||||
{
|
||||
return JenkinsOneAtATime::Compute(data.data(), data.size());
|
||||
}
|
||||
|
||||
unsigned int JenkinsOneAtATime::Compute(const char *key, size_t len)
|
||||
{
|
||||
unsigned int hash, i;
|
||||
|
@ -300,6 +300,7 @@ namespace Utils
|
||||
class JenkinsOneAtATime
|
||||
{
|
||||
public:
|
||||
static unsigned int Compute(std::string data);
|
||||
static unsigned int Compute(const char *key, size_t len);
|
||||
};
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ namespace Utils
|
||||
{
|
||||
void* data = new char[length];
|
||||
|
||||
assert(data != nullptr);
|
||||
|
||||
if (data)
|
||||
{
|
||||
ZeroMemory(data, length);
|
||||
@ -23,7 +25,10 @@ namespace Utils
|
||||
|
||||
void Memory::Free(void* data)
|
||||
{
|
||||
delete[] data;
|
||||
if (data)
|
||||
{
|
||||
delete[] data;
|
||||
}
|
||||
}
|
||||
|
||||
void Memory::Free(const void* data)
|
||||
|
@ -14,6 +14,11 @@ namespace Utils
|
||||
this->RefMemory.clear();
|
||||
}
|
||||
~Allocator()
|
||||
{
|
||||
this->Free();
|
||||
}
|
||||
|
||||
void Free()
|
||||
{
|
||||
for (auto i = this->RefMemory.begin(); i != this->RefMemory.end(); ++i)
|
||||
{
|
||||
|
Reference in New Issue
Block a user