[core] mark some more funcs w/ __attribute_pure__

This commit is contained in:
Glenn Strauss 2019-06-04 21:20:52 -04:00
parent ac8444f2e6
commit 49ed72cef4
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ enum http_header_e {
,HTTP_HEADER_X_FORWARDED_PROTO = 0x04000000
};
__attribute_pure__
enum http_header_e http_header_hkey_get(const char *s, size_t slen);
buffer * http_header_response_get(connection *con, enum http_header_e id, const char *k, size_t klen);

View File

@ -53,6 +53,7 @@ typedef struct stat_cache {
/* the famous DJB hash function for strings */
__attribute_pure__
static uint32_t djbhash(const char *str, const size_t len)
{
const unsigned char * const s = (const unsigned char *)str;
@ -62,6 +63,7 @@ static uint32_t djbhash(const char *str, const size_t len)
}
__attribute_pure__
static uint32_t hashme(const char *str, const size_t len)
{
/* strip highest bit of hash value for splaytree */