summaryrefslogtreecommitdiff
path: root/src/buffer_utils.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-02-06 21:57:17 +1100
committerMaxime Coste <mawww@kakoune.org>2024-02-06 21:57:17 +1100
commit04a96b059faac8100a291e56bfbdb1962d53d4e1 (patch)
tree82191cd45870634637c4a7ee0f437d5fd52111e3 /src/buffer_utils.cc
parent53d9b9b67650a2b34345d9153bef2a01cb75c418 (diff)
Use different hash algorithms for strings and file hashing
For hash map, using fnv1a is faster as it is a much simpler algorithm we can afford to inline. For files murmur3 should win as it processes bytes 4 by 4.
Diffstat (limited to 'src/buffer_utils.cc')
-rw-r--r--src/buffer_utils.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc
index 21ec7092..be255e4a 100644
--- a/src/buffer_utils.cc
+++ b/src/buffer_utils.cc
@@ -140,7 +140,7 @@ decltype(auto) parse_file(StringView filename, Func&& func)
const bool crlf = has_crlf and not has_lf;
auto eolformat = crlf ? EolFormat::Crlf : EolFormat::Lf;
- FsStatus fs_status{file.st.st_mtim, file.st.st_size, hash_data(file.data, file.st.st_size)};
+ FsStatus fs_status{file.st.st_mtim, file.st.st_size, murmur3(file.data, file.st.st_size)};
return func(parse_lines(pos, end, eolformat), bom, eolformat, fs_status);
}