libbb: trivial code shrink
function old new delta reset_ino_dev_hashtable 84 74 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
6554d03735
commit
12916b9220
@ -72,13 +72,18 @@ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *
|
|||||||
void FAST_FUNC reset_ino_dev_hashtable(void)
|
void FAST_FUNC reset_ino_dev_hashtable(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ino_dev_hashtable_bucket_t *bucket;
|
ino_dev_hashtable_bucket_t *bucket, *next;
|
||||||
|
|
||||||
for (i = 0; ino_dev_hashtable && i < HASH_SIZE; i++) {
|
if (!ino_dev_hashtable)
|
||||||
while (ino_dev_hashtable[i] != NULL) {
|
return;
|
||||||
bucket = ino_dev_hashtable[i]->next;
|
|
||||||
free(ino_dev_hashtable[i]);
|
for (i = 0; i < HASH_SIZE; i++) {
|
||||||
ino_dev_hashtable[i] = bucket;
|
bucket = ino_dev_hashtable[i];
|
||||||
|
|
||||||
|
while (bucket != NULL) {
|
||||||
|
next = bucket->next;
|
||||||
|
free(bucket);
|
||||||
|
bucket = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(ino_dev_hashtable);
|
free(ino_dev_hashtable);
|
||||||
|
Loading…
Reference in New Issue
Block a user