Small code clean-up.
This commit is contained in:
parent
80d18e0fdb
commit
19a1c2ba47
@ -378,14 +378,8 @@ errno_t DECLARE(hash_map_iterate)(const hash_map_t *const instance, size_t *cons
|
|||||||
{
|
{
|
||||||
if (IS_VALID(instance->data, index))
|
if (IS_VALID(instance->data, index))
|
||||||
{
|
{
|
||||||
if (key)
|
SAFE_SET(key, instance->data.keys[index]);
|
||||||
{
|
SAFE_SET(value, instance->data.values[index]);
|
||||||
*key = instance->data.keys[index];
|
|
||||||
}
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
*value = instance->data.values[index];
|
|
||||||
}
|
|
||||||
*cursor = index + 1U;
|
*cursor = index + 1U;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -407,22 +401,10 @@ errno_t DECLARE(hash_map_info)(const hash_map_t *const instance, size_t *const c
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (capacity)
|
SAFE_SET(capacity, instance->data.capacity);
|
||||||
{
|
SAFE_SET(valid, instance->valid);
|
||||||
*capacity = instance->data.capacity;
|
SAFE_SET(deleted,instance->deleted);
|
||||||
}
|
SAFE_SET(limit, instance->limit);
|
||||||
if (valid)
|
|
||||||
{
|
|
||||||
*valid = instance->valid;
|
|
||||||
}
|
|
||||||
if (deleted)
|
|
||||||
{
|
|
||||||
*deleted = instance->deleted;
|
|
||||||
}
|
|
||||||
if (limit)
|
|
||||||
{
|
|
||||||
*limit = instance->limit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -348,10 +348,7 @@ errno_t DECLARE(hash_set_iterate)(const hash_set_t *const instance, size_t *cons
|
|||||||
{
|
{
|
||||||
if (IS_VALID(instance->data, index))
|
if (IS_VALID(instance->data, index))
|
||||||
{
|
{
|
||||||
if (item)
|
SAFE_SET(item, instance->data.items[index]);
|
||||||
{
|
|
||||||
*item = instance->data.items[index];
|
|
||||||
}
|
|
||||||
*cursor = index + 1U;
|
*cursor = index + 1U;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -373,22 +370,10 @@ errno_t DECLARE(hash_set_info)(const hash_set_t *const instance, size_t *const c
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (capacity)
|
SAFE_SET(capacity, instance->data.capacity);
|
||||||
{
|
SAFE_SET(valid, instance->valid);
|
||||||
*capacity = instance->data.capacity;
|
SAFE_SET(deleted, instance->deleted);
|
||||||
}
|
SAFE_SET(limit, instance->limit);
|
||||||
if (valid)
|
|
||||||
{
|
|
||||||
*valid = instance->valid;
|
|
||||||
}
|
|
||||||
if (deleted)
|
|
||||||
{
|
|
||||||
*deleted = instance->deleted;
|
|
||||||
}
|
|
||||||
if (limit)
|
|
||||||
{
|
|
||||||
*limit = instance->limit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user