LCOV - code coverage report
Current view: top level - src/compiler/hash_tables - symbol_table.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 4 100.0 %
Date: 2016-11-30 13:12:14 Functions: 4 11 36.4 %
Branches: 7 14 50.0 %

           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                 :            : }

Generated by: LCOV version 1.12