LCOV - code coverage report
Current view: top level - basic - string-table.c (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 7 7 100.0 %
Date: 2019-08-23 13:36:53 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 6 6 100.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : 
       3                 :            : #include "string-table.h"
       4                 :            : #include "string-util.h"
       5                 :            : 
       6                 :    1290923 : ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) {
       7                 :            :         size_t i;
       8                 :            : 
       9         [ +  + ]:    1290923 :         if (!key)
      10                 :          4 :                 return -1;
      11                 :            : 
      12         [ +  + ]:    4770053 :         for (i = 0; i < len; ++i)
      13         [ +  + ]:    4751325 :                 if (streq_ptr(table[i], key))
      14                 :    1272191 :                         return (ssize_t) i;
      15                 :            : 
      16                 :      18728 :         return -1;
      17                 :            : }

Generated by: LCOV version 1.14