LCOV - code coverage report
Current view: top level - src/include/utils - hashutils.h (source / functions) Hit Total Coverage
Test: PostgreSQL Lines: 3 3 100.0 %
Date: 2017-09-29 15:12:54 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Utilities for working with hash values.
       3             :  *
       4             :  * Portions Copyright (c) 2017, PostgreSQL Global Development Group
       5             :  */
       6             : 
       7             : #ifndef HASHUTILS_H
       8             : #define HASHUTILS_H
       9             : 
      10             : /*
      11             :  * Combine two hash values, resulting in another hash value, with decent bit
      12             :  * mixing.
      13             :  *
      14             :  * Similar to boost's hash_combine().
      15             :  */
      16             : static inline uint32
      17       29022 : hash_combine(uint32 a, uint32 b)
      18             : {
      19       29022 :     a ^= b + 0x9e3779b9 + (a << 6) + (a >> 2);
      20       29022 :     return a;
      21             : }
      22             : 
      23             : #endif                          /* HASHUTILS_H */

Generated by: LCOV version 1.11