X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgl_anyhash_list2.h;h=2ac0cdae9c82ab7291fdba0d3366a1640652f460;hb=6c38d72875ec56c4b2c250717d458e70b2cb97ef;hp=eb8d6e9771028a8a2c2611601602d52f07483a81;hpb=0a51cf1590113188ff1dc78dc79d2924c262a865;p=gnulib.git diff --git a/lib/gl_anyhash_list2.h b/lib/gl_anyhash_list2.h index eb8d6e977..2ac0cdae9 100644 --- a/lib/gl_anyhash_list2.h +++ b/lib/gl_anyhash_list2.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2006. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Common code of gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c. */ @@ -100,8 +99,7 @@ hash_resize (gl_list_t list, size_t estimate) { gl_hash_entry_t *old_table = list->table; /* Allocate the new table. */ - gl_hash_entry_t *new_table = - (gl_hash_entry_t *) xzalloc (new_size * sizeof (gl_hash_entry_t)); + gl_hash_entry_t *new_table = XCALLOC (new_size, gl_hash_entry_t); size_t i; /* Iterate through the entries of the old table. */ @@ -113,9 +111,9 @@ hash_resize (gl_list_t list, size_t estimate) { gl_hash_entry_t next = node->hash_next; /* Add the entry to the new table. */ - size_t index = node->hashcode % new_size; - node->hash_next = new_table[index]; - new_table[index] = node; + size_t bucket = node->hashcode % new_size; + node->hash_next = new_table[bucket]; + new_table[bucket] = node; node = next; }