LCOV - differential code coverage report
Current view: top level - contrib/ltree - crc32.c (source / functions) Coverage Total Hit CBC
Current: 7a15cff1f11193467898da1c1fabf06fd2caee04 vs 84a3778c79c2d28b4dc281d03ef2ab019b16483b Lines: 100.0 % 10 10 10
Current Date: 2025-12-15 18:36:29 -0500 Functions: 100.0 % 1 1 1
Baseline: lcov-20251216-010103-baseline Branches: 100.0 % 4 4 4
Baseline Date: 2025-12-15 13:30:48 -0800 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
 2085 tgl@sss.pgh.pa.us          24                 :CBC      156917 : ltree_crc32_sz(const char *buf, int size)
                                 25                 :                : {
                                 26                 :                :     pg_crc32    crc;
                                 27                 :         156917 :     const char *p = buf;
                                 28                 :                : 
 4060 heikki.linnakangas@i       29                 :         156917 :     INIT_TRADITIONAL_CRC32(crc);
                                 30         [ +  + ]:         376607 :     while (size > 0)
                                 31                 :                :     {
 3860 bruce@momjian.us           32                 :         219690 :         char        c = (char) TOLOWER(*p);
                                 33                 :                : 
 4060 heikki.linnakangas@i       34         [ +  + ]:         439380 :         COMP_TRADITIONAL_CRC32(crc, &c, 1);
                                 35                 :         219690 :         size--;
                                 36                 :         219690 :         p++;
                                 37                 :                :     }
                                 38                 :         156917 :     FIN_TRADITIONAL_CRC32(crc);
                                 39                 :         156917 :     return (unsigned int) crc;
                                 40                 :                : }
        

Generated by: LCOV version 2.4-beta