Branch data Line data Source code
1 : : /* Note: only one hash table can be implemented a single file. */
2 : : #include "../symbols.h"
3 : : #include "hash/hash_table_def.h"
4 [ # # ]: 2726 : DEFINE_HASH_TABLE(fb_symbol_table)
5 : : #include "hash/hash_table_impl.h"
6 : :
7 : : static inline int ht_match(const void *key, size_t len, fb_symbol_t *sym)
8 : : {
9 [ + + ][ + + ]: 1168 : return len == ht_key_len(sym) && memcmp(key, ht_key(sym), len) == 0;
[ # # ][ # # ]
[ + + ][ + - ]
10 : : }
11 : :
12 : : static inline const void *ht_key(fb_symbol_t *sym)
13 : : {
14 : 1979 : return sym->ident->text;
15 : : }
16 : :
17 : : static inline size_t ht_key_len(fb_symbol_t *sym)
18 : : {
19 : : fb_token_t *ident = sym->ident;
20 : :
21 : 2680 : return ident->len;
22 : : }
|