X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dict.c;h=236e90ed66b74a74c9201aef1510003fbb513c59;hb=e5ad2101831656c7e2a5ba539a1df8a1453f2089;hp=c9a449b65c5502ead57efc4211f26caa0b248888;hpb=c72ced175870b1dc727171867bfa0854862e8199;p=platform%2Fupstream%2Fltrace.git diff --git a/dict.c b/dict.c index c9a449b..236e90e 100644 --- a/dict.c +++ b/dict.c @@ -1,6 +1,6 @@ /* * This file is part of ltrace. - * Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc. + * Copyright (C) 2012, 2013, 2014 Petr Machata, Red Hat Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -476,11 +476,9 @@ dict_eq_int(const int *key1, const int *key2) size_t dict_hash_uint64(const uint64_t *key) { - // I use the same hash function as for 32-bit signed integers. This - // probably will not have great performance for values that don't fit - // into a 32-bit signed int, but this will do for now - int key32 = (int)(*key); - return dict_hash_int(&key32); + int const a = (int) *key; + int const b = (int) (*key >> 32); + return dict_hash_int (&a) ^ dict_hash_int (&b); } int