summaryrefslogtreecommitdiff
path: root/src/vector.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-12-01 11:09:01 +1100
committerMaxime Coste <mawww@kakoune.org>2021-07-12 10:25:58 +1000
commit9e8f555a828286768c07df6753b64e08e7af952e (patch)
treee665ccdf96e9d9d0bd5af0deba198b5a760febf2 /src/vector.hh
parent07750656a86e033f242204f4158c813ae943478d (diff)
Only redraw updated lines
Diffstat (limited to 'src/vector.hh')
-rw-r--r--src/vector.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vector.hh b/src/vector.hh
index e149998d..c87c8aa8 100644
--- a/src/vector.hh
+++ b/src/vector.hh
@@ -2,6 +2,7 @@
#define vector_hh_INCLUDED
#include "memory.hh"
+#include "hash.hh"
#include <vector>
@@ -11,6 +12,15 @@ namespace Kakoune
template<typename T, MemoryDomain domain = memory_domain(Meta::Type<T>{})>
using Vector = std::vector<T, Allocator<T, domain>>;
+template<typename T, MemoryDomain domain>
+size_t hash_value(const Vector<T, domain>& vector)
+{
+ size_t hash = 0x1235678;
+ for (auto&& elem : vector)
+ hash = combine_hash(hash, hash_value(elem));
+ return hash;
+}
+
}
#endif // vector_hh_INCLUDED