Skip to content

Commit

Permalink
Style.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jan 7, 2025
1 parent c44e827 commit f91d721
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions include/bitcoin/database/impl/primitives/hashmap.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ typename CLASS::iterator CLASS::it(const Key& key) const NOEXCEPT
{
return { get_memory(), head_.top(key), key };
}

TEMPLATE
Link CLASS::allocate(const Link& size) NOEXCEPT
{
Expand Down
26 changes: 13 additions & 13 deletions include/bitcoin/database/impl/primitives/manager.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ constexpr size_t CLASS::link_to_position(const Link& link) NOEXCEPT
}
}

// private
TEMPLATE
constexpr typename Link::integer CLASS::cast_link(size_t link) NOEXCEPT
{
using namespace system;
using integer = typename Link::integer;
constexpr auto terminal = Link::terminal;

// link limit is sub1(terminal), where terminal is 2^((8*Link::bytes)-1).
// It is ok for the payload to exceed link limit (link is identity only).
return link >= terminal ? terminal : possible_narrow_cast<integer>(link);
}

// private
TEMPLATE
constexpr Link CLASS::position_to_link(size_t position) NOEXCEPT
Expand All @@ -172,6 +159,19 @@ constexpr Link CLASS::position_to_link(size_t position) NOEXCEPT
}
}

// private
TEMPLATE
constexpr typename Link::integer CLASS::cast_link(size_t link) NOEXCEPT
{
using namespace system;
using integer = typename Link::integer;
constexpr auto terminal = Link::terminal;

// link limit is sub1(terminal), where terminal is 2^((8*Link::bytes)-1).
// It is ok for the payload to exceed link limit (link is identity only).
return link >= terminal ? terminal : possible_narrow_cast<integer>(link);
}

} // namespace database
} // namespace libbitcoin

Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/database/primitives/arraymap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
/// You should have received a copy of the GNU Affero General Public License
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_ARRAY_HPP
#define LIBBITCOIN_DATABASE_PRIMITIVES_ARRAY_HPP
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_ARRAYMAP_HPP
#define LIBBITCOIN_DATABASE_PRIMITIVES_ARRAYMAP_HPP

#include <bitcoin/system.hpp>
#include <bitcoin/database/define.hpp>
Expand Down

0 comments on commit f91d721

Please sign in to comment.