LCOV - differential code coverage report
Current view: top level - contrib/ltree - crc32.c (source / functions) Coverage Total Hit CBC
Current: a2387c32f2f8a1643c7d71b951587e6bcb2d4744 vs 371a302eecdc82274b0ae2967d18fd726a0aa6a1 Lines: 100.0 % 10 10 10
Current Date: 2025-10-26 12:31:50 -0700 Functions: 100.0 % 1 1 1
Baseline: lcov-20251027-010456-baseline Branches: 100.0 % 4 4 4
Baseline Date: 2025-10-26 11:01:32 +1300 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(360..) days: 100.0 % 10 10 10
Function coverage date bins:
(360..) days: 100.0 % 1 1 1
Branch coverage date bins:
(360..) days: 100.0 % 4 4 4

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /* contrib/ltree/crc32.c */
                                  2                 :                : 
                                  3                 :                : /*
                                  4                 :                :  * Implements CRC-32, as used in ltree.
                                  5                 :                :  *
                                  6                 :                :  * Note that the CRC is used in the on-disk format of GiST indexes, so we
                                  7                 :                :  * must stay backwards-compatible!
                                  8                 :                :  */
                                  9                 :                : 
                                 10                 :                : #include "postgres.h"
                                 11                 :                : #include "ltree.h"
                                 12                 :                : 
                                 13                 :                : #ifdef LOWER_NODE
                                 14                 :                : #include <ctype.h>
                                 15                 :                : #define TOLOWER(x)  tolower((unsigned char) (x))
                                 16                 :                : #else
                                 17                 :                : #define TOLOWER(x)  (x)
                                 18                 :                : #endif
                                 19                 :                : 
                                 20                 :                : #include "crc32.h"
                                 21                 :                : #include "utils/pg_crc.h"
                                 22                 :                : 
                                 23                 :                : unsigned int
 2035 tgl@sss.pgh.pa.us          24                 :CBC      155705 : ltree_crc32_sz(const char *buf, int size)
                                 25                 :                : {
                                 26                 :                :     pg_crc32    crc;
                                 27                 :         155705 :     const char *p = buf;
                                 28                 :                : 
 4010 heikki.linnakangas@i       29                 :         155705 :     INIT_TRADITIONAL_CRC32(crc);
                                 30         [ +  + ]:         373306 :     while (size > 0)
                                 31                 :                :     {
 3810 bruce@momjian.us           32                 :         217601 :         char        c = (char) TOLOWER(*p);
                                 33                 :                : 
 4010 heikki.linnakangas@i       34         [ +  + ]:         435202 :         COMP_TRADITIONAL_CRC32(crc, &c, 1);
                                 35                 :         217601 :         size--;
                                 36                 :         217601 :         p++;
                                 37                 :                :     }
                                 38                 :         155705 :     FIN_TRADITIONAL_CRC32(crc);
                                 39                 :         155705 :     return (unsigned int) crc;
                                 40                 :                : }
        

Generated by: LCOV version 2.4-beta