Skip to content

Commit

Permalink
remove slow_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Sep 12, 2024
1 parent 59c0f0d commit 57f3f86
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 27 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(
'cpp',
license: 'MPL-2.0',

version: '0.25.1',
version: '0.26.0',
default_options: ['warning_level=2', 'buildtype=release', 'cpp_std=c++20'],
meson_version: '>=1.3.2' #first version with clang-cl openmp support,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: 4f69f49d2aedc16b66be38281b5f81b71b5e9fbc6674c2edd7b1e4ac4cee1160
//sourcehash: 06b2ab4630295aaaa2fdf829b7246c5e63e47c2ee6b60bd6a90d0ea709ab98db

/*
This file contains docstrings for use in the Python bindings.
Expand Down
21 changes: 1 addition & 20 deletions src/themachinethatgoesping/tools/classhelper/xxhashhelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class XXHashSink : public boost::iostreams::sink
this->to_stream(stream); \
stream.flush(); \
return hash.digest(); \
} \
__SLOW_HASH_NOT_CONST__
}

#define __BINARY_HASH__ /** @brief compute a 64 bit hash of the object using xxhash and the \
* to_binary function. This function is called binary because the \
Expand All @@ -61,22 +60,4 @@ class XXHashSink : public boost::iostreams::sink
stream.flush(); \
return hash.digest(); \
} \
__SLOW_HASH__

#define __SLOW_HASH_NOT_CONST__ \
/** @brief compute a 64 bit hash of the object using xxhash and the to_binary function. \
* This function is called slow because the to_binary function creates a copy \
*/ \
xxh::hash_t<64> slow_hash() \
{ \
return xxh::xxhash3<64>(this->to_binary()); \
}

#define __SLOW_HASH__ \
/** @brief compute a 64 bit hash of the object using xxhash and the \
* to_binary function. This function is called binary because the to_binary function creates \
* a copy */ \
xxh::hash_t<64> slow_hash() const \
{ \
return xxh::xxhash3<64>(this->to_binary()); \
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: f71190c95864baae989c16cbfcc9e2f61e1d70f371e91c1bcd0a750ef1cb0793
//sourcehash: 7a73824910863e2e3143efa1e1cb5770ad2a07da93d13965481fdbf01b099afb

/*
This file contains docstrings for use in the Python bindings.
Expand Down
4 changes: 0 additions & 4 deletions src/themachinethatgoesping/tools_pybind/classhelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
"hash", \
[](T_CLASS& self) { return self.binary_hash(); }, \
"hash function implemented using binary_hash") \
.def( \
"slow_hash", \
[](T_CLASS& self) { return self.slow_hash(); }, \
"hash function implemented using slow_hash")

#define __PYCLASS_DEFAULT_BINARY__1__(T_CLASS) \
.def( \
Expand Down

0 comments on commit 57f3f86

Please sign in to comment.