@@ -399,7 +399,7 @@ struct StringEq : std::equal_to<absl::string_view> {
399
399
struct StringTable
400
400
: raw_hash_set<StringPolicy, StringHash, StringEq, std::allocator<int >> {
401
401
using Base = typename StringTable::raw_hash_set;
402
- StringTable () {}
402
+ StringTable () = default ;
403
403
using Base::Base;
404
404
};
405
405
@@ -419,7 +419,7 @@ struct Uint8Table
419
419
420
420
template <typename T>
421
421
struct CustomAlloc : std::allocator<T> {
422
- CustomAlloc () {}
422
+ CustomAlloc () = default ;
423
423
424
424
template <typename U>
425
425
explicit CustomAlloc (const CustomAlloc<U>& /* other*/ ) {}
@@ -446,7 +446,7 @@ struct BadFastHash {
446
446
struct BadTable : raw_hash_set<IntPolicy, BadFastHash, std::equal_to<int >,
447
447
std::allocator<int >> {
448
448
using Base = typename BadTable::raw_hash_set;
449
- BadTable () {}
449
+ BadTable () = default ;
450
450
using Base::Base;
451
451
};
452
452
@@ -1003,7 +1003,7 @@ TEST(Table, ClearBug) {
1003
1003
// We are checking that original and second are close enough to each other
1004
1004
// that they are probably still in the same group. This is not strictly
1005
1005
// guaranteed.
1006
- EXPECT_LT (std::abs (original - second),
1006
+ EXPECT_LT (static_cast < size_t >( std::abs (original - second) ),
1007
1007
capacity * sizeof (IntTable::value_type));
1008
1008
}
1009
1009
@@ -1080,19 +1080,6 @@ struct ProbeStats {
1080
1080
// Ratios total_probe_length/size for every tested table.
1081
1081
std::vector<double > single_table_ratios;
1082
1082
1083
- friend ProbeStats operator +(const ProbeStats& a, const ProbeStats& b) {
1084
- ProbeStats res = a;
1085
- res.all_probes_histogram .resize (std::max (res.all_probes_histogram .size (),
1086
- b.all_probes_histogram .size ()));
1087
- std::transform (b.all_probes_histogram .begin (), b.all_probes_histogram .end (),
1088
- res.all_probes_histogram .begin (),
1089
- res.all_probes_histogram .begin (), std::plus<size_t >());
1090
- res.single_table_ratios .insert (res.single_table_ratios .end (),
1091
- b.single_table_ratios .begin (),
1092
- b.single_table_ratios .end ());
1093
- return res;
1094
- }
1095
-
1096
1083
// Average ratio total_probe_length/size over tables.
1097
1084
double AvgRatio () const {
1098
1085
return std::accumulate (single_table_ratios.begin (),
@@ -1555,7 +1542,7 @@ TEST(Table, CopyConstructWithAlloc) {
1555
1542
struct ExplicitAllocIntTable
1556
1543
: raw_hash_set<IntPolicy, container_internal::hash_default_hash<int64_t >,
1557
1544
std::equal_to<int64_t >, Alloc<int64_t >> {
1558
- ExplicitAllocIntTable () {}
1545
+ ExplicitAllocIntTable () = default ;
1559
1546
};
1560
1547
1561
1548
TEST (Table, AllocWithExplicitCtor) {
@@ -1943,7 +1930,7 @@ TEST(Nodes, ExtractInsert) {
1943
1930
EXPECT_FALSE (res.inserted );
1944
1931
EXPECT_THAT (*res.position , Pair (k0, " " ));
1945
1932
EXPECT_TRUE (res.node );
1946
- EXPECT_FALSE (node);
1933
+ EXPECT_FALSE (node); // NOLINT(bugprone-use-after-move)
1947
1934
}
1948
1935
1949
1936
TEST (Nodes, HintInsert) {
@@ -1953,7 +1940,7 @@ TEST(Nodes, HintInsert) {
1953
1940
auto it = t.insert (t.begin (), std::move (node));
1954
1941
EXPECT_THAT (t, UnorderedElementsAre (1 , 2 , 3 ));
1955
1942
EXPECT_EQ (*it, 1 );
1956
- EXPECT_FALSE (node);
1943
+ EXPECT_FALSE (node); // NOLINT(bugprone-use-after-move)
1957
1944
1958
1945
node = t.extract (2 );
1959
1946
EXPECT_THAT (t, UnorderedElementsAre (1 , 3 ));
@@ -1963,7 +1950,7 @@ TEST(Nodes, HintInsert) {
1963
1950
it = t.insert (t.begin (), std::move (node));
1964
1951
EXPECT_EQ (*it, 2 );
1965
1952
// The node was not emptied by the insert call.
1966
- EXPECT_TRUE (node);
1953
+ EXPECT_TRUE (node); // NOLINT(bugprone-use-after-move)
1967
1954
}
1968
1955
1969
1956
IntTable MakeSimpleTable (size_t size) {
0 commit comments