Coverage Report

Created: 2026-05-16 09:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/o3tl/hash_combine.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#pragma once
11
12
#include <cstddef>
13
#include <functional>
14
#include <o3tl/concepts.hxx>
15
16
namespace o3tl
17
{
18
template <typename T, type_32_bit N>
19
inline void hash_combine(N& nSeed, T const* pValue, size_t nCount)
20
{
21
    static_assert(sizeof(nSeed) == 4);
22
    for (size_t i = 0; i < nCount; ++i)
23
    {
24
        nSeed ^= std::hash<T>{}(*pValue) + 0x9E3779B9u + (nSeed << 6) + (nSeed >> 2);
25
        ++pValue;
26
    }
27
}
28
29
template <typename T, type_32_bit N> inline void hash_combine(N& nSeed, T const& nValue)
30
{
31
    static_assert(sizeof(nSeed) == 4);
32
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B9u + (nSeed << 6) + (nSeed >> 2);
33
}
34
35
template <typename T, type_64_bit N>
36
inline void hash_combine(N& nSeed, T const* pValue, size_t nCount)
37
{
38
    static_assert(sizeof(nSeed) == 8);
39
    for (size_t i = 0; i < nCount; ++i)
40
    {
41
        nSeed ^= std::hash<T>{}(*pValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
42
        ++pValue;
43
    }
44
}
45
46
template <typename T, type_64_bit N> inline void hash_combine(N& nSeed, T const& nValue)
47
1.30G
{
48
1.30G
    static_assert(sizeof(nSeed) == 8);
49
1.30G
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
1.30G
}
_ZN4o3tl12hash_combineIjTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
113M
{
48
113M
    static_assert(sizeof(nSeed) == 8);
49
113M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
113M
}
_ZN4o3tl12hash_combineI10FontWeightTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineIP9SalBitmapTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
6.28k
{
48
6.28k
    static_assert(sizeof(nSeed) == 8);
49
6.28k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
6.28k
}
_ZN4o3tl12hash_combineIlTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
59.8M
{
48
59.8M
    static_assert(sizeof(nSeed) == 8);
49
59.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
59.8M
}
_ZN4o3tl12hash_combineIPK19LogicalFontInstanceTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
59.1M
{
48
59.1M
    static_assert(sizeof(nSeed) == 8);
49
59.1M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
59.1M
}
_ZN4o3tl12hash_combineImTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
90.2M
{
48
90.2M
    static_assert(sizeof(nSeed) == 8);
49
90.2M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
90.2M
}
_ZN4o3tl12hash_combineIfTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
22.8M
{
48
22.8M
    static_assert(sizeof(nSeed) == 8);
49
22.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
22.8M
}
_ZN4o3tl12hash_combineIiTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
161M
{
48
161M
    static_assert(sizeof(nSeed) == 8);
49
161M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
161M
}
_ZN4o3tl12hash_combineI11GfxLinkTypeTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
16
{
48
16
    static_assert(sizeof(nSeed) == 8);
49
16
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
16
}
_ZN4o3tl12hash_combineIPK12OutputDeviceTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineIdTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
64.0M
{
48
64.0M
    static_assert(sizeof(nSeed) == 8);
49
64.0M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
64.0M
}
_ZN4o3tl12hash_combineIbTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
133M
{
48
133M
    static_assert(sizeof(nSeed) == 8);
49
133M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
133M
}
_ZN4o3tl12hash_combineIN3vcl4text22ComplexTextLayoutFlagsETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineItTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
124M
{
48
124M
    static_assert(sizeof(nSeed) == 8);
49
124M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
124M
}
_ZN4o3tl12hash_combineI10FontFamilyTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
31.8M
{
48
31.8M
    static_assert(sizeof(nSeed) == 8);
49
31.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
31.8M
}
_ZN4o3tl12hash_combineI7MapUnitTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
28.0M
{
48
28.0M
    static_assert(sizeof(nSeed) == 8);
49
28.0M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
28.0M
}
Unexecuted instantiation: _ZN4o3tl12hash_combineI11ControlTypeTkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineI11ControlPartTkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineIhTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
4.50M
{
48
4.50M
    static_assert(sizeof(nSeed) == 8);
49
4.50M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
4.50M
}
_ZN4o3tl12hash_combineI10FontItalicTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineI9FontPitchTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
20.9M
{
48
20.9M
    static_assert(sizeof(nSeed) == 8);
49
20.9M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
20.9M
}
_ZN4o3tl12hash_combineI9TextAlignTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineIsTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
109M
{
48
109M
    static_assert(sizeof(nSeed) == 8);
49
109M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
109M
}
_ZN4o3tl12hash_combineIN3rtl8OUStringETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
21.8M
{
48
21.8M
    static_assert(sizeof(nSeed) == 8);
49
21.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
21.8M
}
_ZN4o3tl12hash_combineI13FontLineStyleTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
21.7M
{
48
21.7M
    static_assert(sizeof(nSeed) == 8);
49
21.7M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
21.7M
}
_ZN4o3tl12hash_combineI13FontStrikeoutTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineI10FontReliefTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineI16FontEmphasisMarkTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineI11FontKerningTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
10.8M
{
48
10.8M
    static_assert(sizeof(nSeed) == 8);
49
10.8M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
10.8M
}
_ZN4o3tl12hash_combineI9FontWidthTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
4.59k
{
48
4.59k
    static_assert(sizeof(nSeed) == 8);
49
4.59k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
4.59k
}
_ZN4o3tl12hash_combineIN5model18TransformationTypeETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
726k
{
48
726k
    static_assert(sizeof(nSeed) == 8);
49
726k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
726k
}
_ZN4o3tl12hash_combineIN3com3sun4star3awt9FontSlantETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
62.4k
{
48
62.4k
    static_assert(sizeof(nSeed) == 8);
49
62.4k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
62.4k
}
_ZN4o3tl12hash_combineIN5model12ComplexColorETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
6.48M
{
48
6.48M
    static_assert(sizeof(nSeed) == 8);
49
6.48M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
6.48M
}
_ZN4o3tl12hash_combineI9ScAddressTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
5.80k
{
48
5.80k
    static_assert(sizeof(nSeed) == 8);
49
5.80k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
5.80k
}
Unexecuted instantiation: _ZN4o3tl12hash_combineIN18ScSortedRangeCache9ValueTypeETkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineI9ScQueryOpTkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineIN12ScQueryEntry9QueryTypeETkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineIPK12_rtl_uStringTkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineIN5model9ColorTypeETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
6.48M
{
48
6.48M
    static_assert(sizeof(nSeed) == 8);
49
6.48M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
6.48M
}
_ZN4o3tl12hash_combineIN5model15SystemColorTypeETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
6.48M
{
48
6.48M
    static_assert(sizeof(nSeed) == 8);
49
6.48M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
6.48M
}
_ZN4o3tl12hash_combineIN5model14TransformationETkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
726k
{
48
726k
    static_assert(sizeof(nSeed) == 8);
49
726k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
726k
}
_ZN4o3tl12hash_combineI12SvxURLFormatTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
31.8k
{
48
31.8k
    static_assert(sizeof(nSeed) == 8);
49
31.8k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
31.8k
}
_ZN4o3tl12hash_combineI18SvxGraphicPositionTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
158k
{
48
158k
    static_assert(sizeof(nSeed) == 8);
49
158k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
158k
}
_ZN4o3tl12hash_combineIaTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
158k
{
48
158k
    static_assert(sizeof(nSeed) == 8);
49
158k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
158k
}
_ZN4o3tl12hash_combineI16SvxLineSpaceRuleTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
244k
{
48
244k
    static_assert(sizeof(nSeed) == 8);
49
244k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
244k
}
_ZN4o3tl12hash_combineI21SvxInterLineSpaceRuleTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
244k
{
48
244k
    static_assert(sizeof(nSeed) == 8);
49
244k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
244k
}
Unexecuted instantiation: _ZN4o3tl12hash_combineI9SvxAdjustTkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineI12SvxTabAdjustTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
2.16M
{
48
2.16M
    static_assert(sizeof(nSeed) == 8);
49
2.16M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
2.16M
}
Unexecuted instantiation: _ZN4o3tl12hash_combineIN3svx5frame7RefModeETkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineI18SvxBorderLineStyleTkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineI13SvxRotateModeTkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineI14XmlStyleFamilyTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
281k
{
48
281k
    static_assert(sizeof(nSeed) == 8);
49
281k
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
281k
}
Unexecuted instantiation: _ZN4o3tl12hash_combineIN6xmloff5token12XMLTokenEnumETkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineI18_typelib_TypeClassTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
107M
{
48
107M
    static_assert(sizeof(nSeed) == 8);
49
107M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
107M
}
Unexecuted instantiation: _ZN4o3tl12hash_combineIDsTkNS_11type_64_bitEmEEvRT0_RKT_
_ZN4o3tl12hash_combineI11SwFrameSizeTkNS_11type_64_bitEmEEvRT0_RKT_
Line
Count
Source
47
4.29M
{
48
4.29M
    static_assert(sizeof(nSeed) == 8);
49
4.29M
    nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
50
4.29M
}
Unexecuted instantiation: _ZN4o3tl12hash_combineINSt3__18optionalItEETkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineIPK10SwPageDescTkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineIPK12SwCharFormatTkNS_11type_64_bitEmEEvRT0_RKT_
Unexecuted instantiation: _ZN4o3tl12hash_combineIN7basegfx11B2DLineJoinETkNS_11type_64_bitEmEEvRT0_RKT_
51
}
52
53
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */