mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Remove the unused calchash djb2 hash function
Note that hashmap.c uses its own FNV-1a hash function
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
uint32_t calchash(const char *s);
|
|
||||||
char const *printChar(int c);
|
char const *printChar(int c);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @return The number of bytes read, or 0 if invalid data was found
|
* @return The number of bytes read, or 0 if invalid data was found
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,21 +15,6 @@
|
|||||||
|
|
||||||
#include "extern/utf8decoder.h"
|
#include "extern/utf8decoder.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate the hash value for a string.
|
|
||||||
* Uses the djb2 algorithm (xor version).
|
|
||||||
* http://www.cse.yorku.ca/~oz/hash.html
|
|
||||||
*/
|
|
||||||
uint32_t calchash(const char *s)
|
|
||||||
{
|
|
||||||
uint32_t hash = 5381;
|
|
||||||
|
|
||||||
while (*s != 0)
|
|
||||||
hash = (hash * 33) ^ (*s++);
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
char const *printChar(int c)
|
char const *printChar(int c)
|
||||||
{
|
{
|
||||||
// "'A'" + '\0': 4 bytes
|
// "'A'" + '\0': 4 bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user