aboutsummaryrefslogtreecommitdiffstats
path: root/storageapi
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-11-25 13:59:23 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-11-25 13:59:23 +0000
commite9e1b5ef1e6cd77ff5e198ac2ff70449499371af (patch)
tree513c1fee5a3b4dc159c45e29b906ae03df72e996 /storageapi
parentc090dda709692c07ca492b698af9db3e1a76d8e1 (diff)
Simplify hash calculation.
Diffstat (limited to 'storageapi')
-rw-r--r--storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
index f50c5540f7a..9c5df379d22 100644
--- a/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
+++ b/storageapi/src/vespa/storageapi/messageapi/storagemessage.cpp
@@ -154,13 +154,8 @@ createAddress(vespalib::stringref cluster, const lib::NodeType& type, uint16_t i
size_t
calculate_node_hash(const lib::NodeType& type, uint16_t index)
{
- struct NodeValue {
- uint16_t type;
- uint16_t index;
- NodeValue(const lib::NodeType& type_in, uint16_t index_in) : type(type_in), index(index_in) {}
- };
- NodeValue value(type, index);
- return vespalib::hashValue(&value, sizeof(NodeValue));
+ uint16_t buf[] = { type, index };
+ return vespalib::hashValue(&buf, sizeof(buf));
}
// TODO we ideally want this removed. Currently just in place to support usage as map key when emplacement not available