mirror of
https://github.com/thunderbrewhq/common.git
synced 2025-12-12 11:12:29 +00:00
chore(string): tidy up code style in CStringManager
This commit is contained in:
parent
69a95ae405
commit
f395a2dc9d
2 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#include "common/string/CStringManager.hpp"
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
|
@ -23,8 +22,8 @@ CStringManager::CStringManager() {
|
|||
}
|
||||
|
||||
char* CStringManager::Add(const char* str) {
|
||||
uint32_t hashval = SStrHashHT(str);
|
||||
uint32_t bucketIdx = hashval % 0x209;
|
||||
auto hashval = SStrHashHT(str);
|
||||
auto bucketIdx = hashval % C_STRING_MANAGER_BUCKETS;
|
||||
auto bucket = this->m_buckets[bucketIdx];
|
||||
|
||||
if (bucket) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "common/string/CStringMemory.hpp"
|
||||
|
||||
#define C_STRING_MANAGER_BUCKETS 521
|
||||
|
||||
struct CStringElement;
|
||||
|
||||
class CStringManager {
|
||||
|
|
@ -14,7 +16,7 @@ class CStringManager {
|
|||
static CStringManager* Get();
|
||||
|
||||
// Member variables
|
||||
CStringElement* m_buckets[521];
|
||||
CStringElement* m_buckets[C_STRING_MANAGER_BUCKETS];
|
||||
CStringMemory m_memory;
|
||||
|
||||
// Member functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue