Skip to content

Commit 03274cb

Browse files
committed
clang format
1 parent 7305888 commit 03274cb

File tree

5 files changed

+24
-29
lines changed

5 files changed

+24
-29
lines changed

ExcaliburHash/ExcaliburHash.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -966,12 +966,11 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
966966

967967
private:
968968
// prefix m_ to be able to easily see member access from the code (it could be more expensive in the inner loop)
969-
TItem* m_storage; // 8
970-
uint32_t m_numBuckets; // 4
971-
uint32_t m_numElements; // 4
969+
TItem* m_storage; // 8
970+
uint32_t m_numBuckets; // 4
971+
uint32_t m_numElements; // 4
972972
uint32_t m_numTombstones; // 4
973-
//padding 4
974-
973+
// padding 4
975974

976975
template <typename INTEGRAL_TYPE> inline static constexpr bool isPow2(INTEGRAL_TYPE x) noexcept
977976
{

ExcaliburHashTest02.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,11 @@ TEST(SmFlatHashMap, CtorDtorCallCount)
119119
EXPECT_EQ(ctorCallCount, dtorCallCount);
120120
}
121121

122-
123-
124122
struct BadHashStruct
125123
{
126124
int v = 0;
127125
};
128126

129-
130127
namespace Excalibur
131128
{
132129
template <> struct KeyInfo<BadHashStruct>
@@ -144,7 +141,6 @@ template <> struct KeyInfo<BadHashStruct>
144141
};
145142
} // namespace Excalibur
146143

147-
148144
TEST(SmFlatHashMap, InsertEraseReinsert)
149145
{
150146
const int kNumElements = 1024;

ExcaliburHashTest03.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "ExcaliburHash.h"
22
#include "gtest/gtest.h"
33

4-
54
#define EXLBR_UNUSED(x) (void)(x)
65

76
struct CustomStruct
@@ -293,7 +292,6 @@ TEST(SmFlatHashMap, CopyTest)
293292
EXPECT_EQ(ht1.size(), uint32_t(1));
294293
EXPECT_NE(ht1.find(1), ht1.iend());
295294

296-
297295
Excalibur::HashTable<int, nullptr_t> ht4;
298296
ht4.emplace(1);
299297
ht4.emplace(2);
@@ -325,10 +323,11 @@ TEST(SmFlatHashMap, CopyEdgeCases)
325323

326324
/*
327325
from Clang 7.0.0 release notes
328-
326+
329327
-Wself-assign and -Wself-assign-field were extended to diagnose self-assignment operations using overloaded operators (i.e. classes).
330-
If you are doing such an assignment intentionally, e.g. in a unit test for a data structure, the first warning can be disabled by passing
331-
-Wno-self-assign-overloaded, also the warning can be suppressed by adding *& to the right-hand side or casting it to the appropriate reference type.
328+
If you are doing such an assignment intentionally, e.g. in a unit test for a data structure, the first warning can be disabled by
329+
passing -Wno-self-assign-overloaded, also the warning can be suppressed by adding *& to the right-hand side or casting it to the
330+
appropriate reference type.
332331
*/
333332
ht1 = *&ht1;
334333
EXPECT_EQ(ht1.size(), uint32_t(3));

ExcaliburHashTest04.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ TEST(SmFlatHashMap, CopyableIterators)
116116
std::sort(before.begin(), before.end());
117117
}
118118

119-
120119
// iterate and remove
121120
{
122121
for (Excalibur::HashTable<std::string, std::string>::IteratorKV it3 = ht.ibegin(); it3 != ht.iend(); ++it3)
@@ -159,5 +158,5 @@ TEST(SmFlatHashMap, CopyableIterators)
159158
int iv = std::stoi(v);
160159
sumAfter += iv;
161160
}
162-
EXPECT_EQ(sumBefore-5-9, sumAfter);
161+
EXPECT_EQ(sumBefore - 5 - 9, sumAfter);
163162
}

ExcaliburHashTest06.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
TEST(SmFlatHashMap, Rehash)
77
{
8-
Excalibur::HashTable<int, int> ht;
8+
Excalibur::HashTable<int, int> ht;
99
ht.emplace(1, -1);
1010
ht.erase(1);
1111

@@ -44,26 +44,28 @@ TEST(SmFlatHashMap, Rehash)
4444
EXPECT_EQ(ht.getNumTombstones(), uint32_t(0));
4545
}
4646

47-
48-
4947
TEST(SmFlatHashMap, TestTmp)
5048
{
5149
class StringInternStringData
5250
{
53-
public:
51+
public:
5452
inline StringInternStringData()
55-
: refCount(0), string()
56-
{ }
57-
58-
inline StringInternStringData(const std::string &string)
59-
: refCount(1), string(string)
60-
{ }
61-
53+
: refCount(0)
54+
, string()
55+
{
56+
}
57+
58+
inline StringInternStringData(const std::string& string)
59+
: refCount(1)
60+
, string(string)
61+
{
62+
}
63+
6264
int64_t refCount;
6365
std::string string;
64-
};
66+
};
6567

66-
Excalibur::HashTable<std::string, std::unique_ptr<StringInternStringData>> exMap;
68+
Excalibur::HashTable<std::string, std::unique_ptr<StringInternStringData>> exMap;
6769
auto inserted = exMap.emplace(std::string("test"), std::make_unique<StringInternStringData>("test"));
6870
EXPECT_EQ(inserted.second, true);
6971
EXPECT_NE(inserted.first, exMap.end());

0 commit comments

Comments
 (0)