Skip to content

Commit 39b8412

Browse files
Copilotjll63
andcommitted
Remove trailing spaces
Co-authored-by: jll63 <[email protected]>
1 parent 509fcaa commit 39b8412

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/boost/openmethod/policies/minimal_perfect_hash.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct minimal_perfect_hash : type_hash {
9999
//!
100100
//! Uses the PtHash algorithm to find:
101101
//! - Pilot hash parameters (M, N) for H(x) = (M * x) >> N
102-
//! - Bucket assignment parameters
102+
//! - Bucket assignment parameters
103103
//! - Displacement values for each bucket to achieve minimal perfect hashing
104104
//!
105105
//! If no suitable values are found, calls the error handler with
@@ -199,7 +199,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
199199
constexpr std::size_t WASTE_FACTOR_DENOMINATOR = 10;
200200
constexpr std::size_t ROUNDING_ADJUSTMENT = 9; // For ceiling division
201201
table_size = (N * WASTE_FACTOR_NUMERATOR + ROUNDING_ADJUSTMENT) / WASTE_FACTOR_DENOMINATOR;
202-
202+
203203
if (table_size == 0) {
204204
shift = 0;
205205
mult = 1;
@@ -209,7 +209,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
209209
detail::minimal_perfect_hash_displacements<Registry>.clear();
210210
return;
211211
}
212-
212+
213213
if (table_size == 1) {
214214
// Special case: only one type
215215
constexpr std::size_t bits_per_type_id = 8 * sizeof(type_id);
@@ -254,7 +254,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
254254
// Number of groups: typically sqrt(N) to N/4 for good performance
255255
num_groups = (std::max)(std::size_t(1), table_size / DEFAULT_GROUP_DIVISOR);
256256
if (num_groups > table_size) num_groups = table_size;
257-
257+
258258
// Calculate bits needed for num_groups
259259
std::size_t GM = 0;
260260
std::size_t power = 1;
@@ -272,7 +272,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
272272
for (std::size_t pass = 0; pass < MAX_PASSES && total_attempts < MAX_ATTEMPTS; ++pass) {
273273
mult = uniform_dist(rnd) | 1;
274274
group_mult = uniform_dist(rnd) | 1;
275-
275+
276276
// Calculate M for pilot hash (number of bits for table_size range)
277277
std::size_t M = 0;
278278
power = 1;
@@ -298,7 +298,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
298298
// Process groups in descending order of size (larger groups first)
299299
std::vector<std::size_t> group_order(num_groups);
300300
for (std::size_t i = 0; i < num_groups; ++i) group_order[i] = i;
301-
std::sort(group_order.begin(), group_order.end(),
301+
std::sort(group_order.begin(), group_order.end(),
302302
[&groups](std::size_t a, std::size_t b) {
303303
return groups[a].size() > groups[b].size();
304304
});
@@ -359,7 +359,7 @@ void minimal_perfect_hash::fn<Registry>::initialize(
359359
if (used_count == keys.size()) {
360360
if constexpr (InitializeContext::template has_option<trace>) {
361361
ctx.tr << " Found minimal perfect hash after " << total_attempts
362-
<< " attempts; " << used_count << "/" << table_size
362+
<< " attempts; " << used_count << "/" << table_size
363363
<< " slots used\n";
364364
}
365365
return;
@@ -396,7 +396,7 @@ void minimal_perfect_hash::fn<Registry>::check(std::size_t index, type_id type)
396396

397397
template<class Registry, class Stream>
398398
auto minimal_perfect_hash::search_error::write(Stream& os) const -> void {
399-
os << "could not find minimal perfect hash factors after " << attempts
399+
os << "could not find minimal perfect hash factors after " << attempts
400400
<< " attempts using " << buckets << " buckets\n";
401401
}
402402

test/test_minimal_perfect_hash.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(minimal_hash_properties) {
128128
BOOST_TEST(get_id(d3) == 3);
129129
BOOST_TEST(get_id(d4) == 4);
130130
BOOST_TEST(get_id(d5) == 5);
131-
131+
132132
// Verify that the hash function produces a minimal perfect hash
133133
// (This is implicit - if it didn't, initialization would fail or we'd get wrong results)
134134
}

0 commit comments

Comments
 (0)