Keeping crc around, but cleaning up a bit

Crc is used as an optimisation for operator==, which is legit.
Either way, the struct's size would still be 16 even without
the crc (the variable would just became an always 0 "reserved").
Crc's use is limited to here anyways, so for now it's not
harming anyone.
This commit is contained in:
King_DuckZ 2022-06-03 09:53:28 +02:00
commit b3ecb69ec0
4 changed files with 11 additions and 12 deletions

View file

@ -16,7 +16,6 @@
*/
#include "wrenpp/class_manager.hpp"
#include "wrenpp/detail/crc32.hpp"
#include <cassert>
namespace wren {
@ -41,7 +40,6 @@ namespace wren {
ClassNameOwning::operator ModuleAndName() const {
return ModuleAndName{
this->raw_buffer(),
crc32c(this->raw_buffer(), this->raw_buffer_size()),
this->module_name().size(),
this->class_name().size()
};

View file

@ -119,7 +119,7 @@ namespace wren {
source_mem = &*dst.insert(it_found, std::move(new_entry));
}
return {source_mem->data(), 0, mod_name.size(), cls_name.size()};
return {source_mem->data(), mod_name.size(), cls_name.size()};
}
} //unnamed namespace