mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Added nullptr safety check in ImHashStr
This commit is contained in:
parent
683f9160b9
commit
dcc3b48c83
1 changed files with 5 additions and 0 deletions
|
|
@ -2380,6 +2380,11 @@ ImGuiID ImHashData(const void* data_p, size_t data_size, ImGuiID seed)
|
|||
// FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements.
|
||||
ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed)
|
||||
{
|
||||
if (data_p == nullptr)
|
||||
{
|
||||
return seed;
|
||||
}
|
||||
|
||||
seed = ~seed;
|
||||
ImU32 crc = seed;
|
||||
const unsigned char* data = (const unsigned char*)data_p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue