Remove dummy 0, store the crc32 there
This commit is contained in:
parent
e8db08931a
commit
b0422b73d6
2 changed files with 6 additions and 3 deletions
|
@ -18,6 +18,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "string_bt.hpp"
|
||||
#include "crc32.hpp"
|
||||
#include <string_view>
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
|
@ -131,11 +132,12 @@ namespace wren {
|
|||
template <dhandy::bt::string S1, dhandy::bt::string S2>
|
||||
constexpr ModuleAndName make_module_and_name() {
|
||||
using dhandy::bt::string;
|
||||
using StaticStorage = detail::ModuleAndNameStaticStorage<S1 + string("\0") + S2>;
|
||||
|
||||
constexpr const char* data = detail::ModuleAndNameStaticStorage<S1 + string("\0") + S2>::value.data();
|
||||
constexpr const char* data = StaticStorage::value.data();
|
||||
constexpr std::uint16_t s1_len = static_cast<std::uint16_t>(S1.size());
|
||||
constexpr std::uint16_t s2_len = static_cast<std::uint16_t>(S2.size());
|
||||
constexpr std::uint32_t hash = 0; //not implemented yet
|
||||
constexpr std::uint32_t hash = crc32c(data, StaticStorage::value.size());
|
||||
|
||||
return ModuleAndName{data, hash, s1_len, s2_len};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue