LCOV - differential code coverage report
Current view: top level - contrib/ltree - crc32.c (source / functions) Coverage Total Hit CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 10 10 10
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: 100.0 % 4 4 4
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 10 10 10
Function coverage date bins:
(240..) days: 100.0 % 1 1 1
Branch coverage date bins:
(240..) 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
 1474 tgl@sss.pgh.pa.us          24                 :CBC      156332 : ltree_crc32_sz(const char *buf, int size)
                                 25                 :                : {
                                 26                 :                :     pg_crc32    crc;
                                 27                 :         156332 :     const char *p = buf;
                                 28                 :                : 
 3449 heikki.linnakangas@i       29                 :         156332 :     INIT_TRADITIONAL_CRC32(crc);
                                 30         [ +  + ]:         375005 :     while (size > 0)
                                 31                 :                :     {
 3249 bruce@momjian.us           32                 :         218673 :         char        c = (char) TOLOWER(*p);
                                 33                 :                : 
 3449 heikki.linnakangas@i       34         [ +  + ]:         437346 :         COMP_TRADITIONAL_CRC32(crc, &c, 1);
                                 35                 :         218673 :         size--;
                                 36                 :         218673 :         p++;
                                 37                 :                :     }
                                 38                 :         156332 :     FIN_TRADITIONAL_CRC32(crc);
                                 39                 :         156332 :     return (unsigned int) crc;
                                 40                 :                : }
        

Generated by: LCOV version 2.1-beta2-3-g6141622