diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-21 10:31:11 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-21 10:31:11 +0000 |
commit | e6345968176bde87ac478b8cea90ed451cbf03d1 (patch) | |
tree | bc40a69d2912d5999e6ddc03e837a03ff338d6a1 | |
parent | a7029c97b111f4a518671cbf56188b9bf986945f (diff) |
Add static_assert on size
-rw-r--r-- | vespalib/src/vespa/vespalib/util/string_hash.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/string_hash.cpp b/vespalib/src/vespa/vespalib/util/string_hash.cpp index a5212401256..de0865fe86f 100644 --- a/vespalib/src/vespa/vespalib/util/string_hash.cpp +++ b/vespalib/src/vespa/vespalib/util/string_hash.cpp @@ -12,6 +12,7 @@ double hash2d(const char *str, size_t len) { h = h & 0xffeffffffffffffful; } double d = 0; + static_assert(sizeof(d) == sizeof(h)); memcpy(&d, &h, sizeof(d)); return d; } |