diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-07-10 11:43:05 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-07-15 11:19:46 -0400 |
commit | 18871cab92aef80bd4a856454a77f8808984dbce (patch) | |
tree | c464c2287cd01c522945d21abc3e9cbbe3e2ac88 /collection/collection.h | |
parent | 67c5c2d2f02e0c90e13b4463b2f1aac458767483 (diff) | |
download | ding-libs-18871cab92aef80bd4a856454a77f8808984dbce.tar.gz ding-libs-18871cab92aef80bd4a856454a77f8808984dbce.tar.xz ding-libs-18871cab92aef80bd4a856454a77f8808984dbce.zip |
COLLECTION Fixed: iterator_up and insert_into_current
During a review of the previous patch the two issues
were found:
a) The col_iterator_up function was not implemented properly
so it got reworked. New implementation changes
the way error condition is handled. Comments were updated accordingly.
b) There was a mising check for validity of the argument in
the col_insert_into_current function. Check was added.
c) Unit test modified to reflect the change in functionality.
Diffstat (limited to 'collection/collection.h')
-rw-r--r-- | collection/collection.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/collection/collection.h b/collection/collection.h index 7de17d2..5483c13 100644 --- a/collection/collection.h +++ b/collection/collection.h @@ -544,9 +544,11 @@ int col_iterate_collection(struct collection_iterator *iterator, * collection 'level' levels up. * The 'Level' parameter indicates how many levels up you want to jump. * If 0 - call is a no op. - * If the depth is less than requested level function will return error EINVAL. + * If the depth is less then requested level the iterator will + * get to the 0 level and next call to col_iterate_collection + * will return NULL item. */ -int col_iterate_up(struct collection_iterator *iterator, int level); +int col_iterate_up(struct collection_iterator *iterator, unsigned level); /* How deep are we relative to the top level. * This function might report depth that might look misleading. |