Skip to content

Commit 8591127

Browse files
committed
Delint.
1 parent 563f734 commit 8591127

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

include/bitcoin/database/impl/primitives/hashmap.ipp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ bool CLASS::put(const Link& link, const Key& key,
308308
const Element& element) NOEXCEPT
309309
{
310310
using namespace system;
311-
const auto count = element.count();
312311
const auto ptr = manager_.get(link);
313312
if (!ptr)
314313
return false;
@@ -319,7 +318,11 @@ bool CLASS::put(const Link& link, const Key& key,
319318
sink.skip_bytes(Link::size);
320319
sink.write_bytes(key);
321320

322-
if constexpr (!is_slab) { BC_DEBUG_ONLY(sink.set_limit(Size * count);) }
321+
if constexpr (!is_slab)
322+
{
323+
BC_DEBUG_ONLY(sink.set_limit(Size * element.count());)
324+
}
325+
323326
auto& next = unsafe_array_cast<uint8_t, Link::size>(ptr->begin());
324327
return element.to_data(sink) && head_.push(link, next, head_.index(key));
325328
}

include/bitcoin/database/impl/primitives/head2.ipp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ Link CLASS::index(const Key& key) const NOEXCEPT
5757
{
5858
// Key is the logical bucket index (no-hash).
5959
if (key < buckets())
60-
return manager::cast_link(key);
60+
return manager<Link, system::data_array<zero>, Link::size>::
61+
cast_link(key);
6162

6263
return {};
6364
}

include/bitcoin/database/primitives/head2.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ class head2
6666
bool push(const bytes& current, const Link& index) NOEXCEPT;
6767

6868
private:
69-
using manager = manager<Link, system::data_array<zero>, Link::size>;
70-
7169
template <size_t Bytes>
7270
static auto& array_cast(memory::iterator buffer) NOEXCEPT
7371
{

test/memory/map.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,8 @@ BOOST_AUTO_TEST_CASE(map__set__no_minimum_expansion__expected_capacity)
481481

482482
BOOST_AUTO_TEST_CASE(map__set__loaded__expected_fill)
483483
{
484+
BC_PUSH_WARNING(NO_POINTER_ARITHMETIC)
485+
484486
constexpr auto half_rate = 50_size;
485487
constexpr auto minimum = 1_size;
486488
constexpr auto size1 = 3_size;
@@ -575,6 +577,8 @@ BOOST_AUTO_TEST_CASE(map__set__loaded__expected_fill)
575577
BOOST_REQUIRE(!instance.unload());
576578
BOOST_REQUIRE(!instance.close());
577579
BOOST_REQUIRE(!instance.get_fault());
580+
581+
BC_POP_WARNING()
578582
}
579583

580584
BOOST_AUTO_TEST_CASE(map__get__unloaded__false)

test/primitives/hashmap2.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ struct record4 { static constexpr size_t size = 4; };
4949
using slab_table = hashmap_<link5, key10, slab0::size>;
5050
using record_table = hashmap_<link5, key10, record4::size>;
5151

52-
constexpr auto element_size = link5::size + array_count<key10> + record4::size;
53-
5452
// record hashmap
5553
// ----------------------------------------------------------------------------
5654

0 commit comments

Comments
 (0)