Skip to content

Commit 8252726

Browse files
committed
Style.
1 parent 9d755f9 commit 8252726

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ Link CLASS::at(size_t key) const NOEXCEPT
134134
// Reads full padded word.
135135
const auto raw = ptr->data();
136136
// xcode clang++16 does not support C++20 std::atomic_ref.
137-
////const std::atomic_ref<integer> head(unsafe_byte_cast<integer>(raw));
138-
const auto& head = *pointer_cast<std::atomic<integer>>(raw);
137+
////const std::atomic_ref<link> head(unsafe_byte_cast<link>(raw));
138+
const auto& head = *pointer_cast<std::atomic<CLASS::link>>(raw);
139139
return head.load(std::memory_order_relaxed);
140140
}
141141
else
@@ -164,8 +164,8 @@ bool CLASS::push(const Link& link, const Link& index) NOEXCEPT
164164
// Writes full padded word (0x00 fill).
165165
const auto raw = ptr->data();
166166
// xcode clang++16 does not support C++20 std::atomic_ref.
167-
////const std::atomic_ref<integer> head(unsafe_byte_cast<integer>(raw));
168-
auto& head = *pointer_cast<std::atomic<integer>>(raw);
167+
////const std::atomic_ref<link> head(unsafe_byte_cast<link>(raw));
168+
auto& head = *pointer_cast<std::atomic<CLASS::link>>(raw);
169169
head.store(link, std::memory_order_relaxed);
170170
}
171171
else

include/bitcoin/database/primitives/arrayhead.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ class arrayhead
7171
bool push(const Link& link, const Link& index) NOEXCEPT;
7272

7373
private:
74-
using integer = Link::integer;
74+
using link = Link::integer;
7575
using body = manager<Link, system::data_array<zero>, Link::size>;
76-
static_assert(std::atomic<integer>::is_always_lock_free);
76+
static_assert(std::atomic<link>::is_always_lock_free);
7777
static_assert(is_nonzero(Link::size));
78-
static constexpr auto bucket_size = Align ? sizeof(integer) : Link::size;
78+
static constexpr auto bucket_size = Align ? sizeof(link) : Link::size;
7979

8080
template <size_t Bytes>
8181
static inline auto& to_array(memory::iterator it) NOEXCEPT
@@ -87,8 +87,7 @@ class arrayhead
8787
{
8888
using namespace system;
8989
const auto offset = floored_divide(position, bucket_size);
90-
const auto link = floored_subtract(offset, one);
91-
return possible_narrow_cast<integer>(link);
90+
return possible_narrow_cast<link>(floored_subtract(offset, one));
9291
}
9392

9493
// Byte offset of bucket index within head file.

0 commit comments

Comments
 (0)