From 955d5259d0d83f8ffbf221dcea3cea5e6764199b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 9 Jan 2015 17:28:40 +0100 Subject: [PATCH] Rewrite sample HashTable description to use the typedefs This makes the code more readable (as KeyType and ValueType are clearer than int and Foo) and easier to copypaste and edit. --- headers/private/kernel/util/OpenHashTable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/private/kernel/util/OpenHashTable.h b/headers/private/kernel/util/OpenHashTable.h index c58fba5445..1baea628df 100644 --- a/headers/private/kernel/util/OpenHashTable.h +++ b/headers/private/kernel/util/OpenHashTable.h @@ -34,22 +34,22 @@ typedef int KeyType; typedef Foo ValueType; - size_t HashKey(int key) const + size_t HashKey(KeyType key) const { return key >> 1; } - size_t Hash(Foo* value) const + size_t Hash(ValueType* value) const { return HashKey(value->bar); } - bool Compare(int key, Foo* value) const + bool Compare(KeyType key, ValueType* value) const { return value->bar == key; } - Foo*& GetLink(Foo* value) const + ValueType*& GetLink(ValueType* value) const { return value->fNext; }