Skip to content

Commit

Permalink
Remove xkb_compose_table_iterator_current
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Sep 25, 2023
1 parent 669f269 commit a27b66c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
5 changes: 3 additions & 2 deletions bench/compose-traversal.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ main(void)
FILE *file;
struct xkb_compose_table *table;
struct xkb_compose_table_iterator *iter;
struct xkb_compose_table_entry *entry;
struct bench bench;
char *elapsed;

Expand Down Expand Up @@ -81,8 +82,8 @@ main(void)
xkb_compose_table_for_each(table, compose_fn, NULL);
#else
iter = xkb_compose_table_iterator_new(table);
while (xkb_compose_table_iterator_next(iter)) {
assert (xkb_compose_table_iterator_current(iter));
while ((entry = xkb_compose_table_iterator_next(iter))) {
assert (entry);
}
xkb_compose_table_iterator_free(iter);
#endif
Expand Down
16 changes: 2 additions & 14 deletions include/xkbcommon/xkbcommon-compose.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ struct xkb_compose_table_iterator;
*
* ```c
* struct xkb_compose_table_iterator *iter = xkb_compose_table_iterator_new(compose_table);
* while (xkb_compose_table_iterator_next(iter)) {
* struct xkb_compose_table_entry * entry = xkb_compose_table_iterator_current(iter);
* struct xkb_compose_table_entry *entry;
* while (entry = xkb_compose_table_iterator_next(iter)) {
* // ...
* }
* xkb_compose_table_iterator_free(iter);
Expand All @@ -452,18 +452,6 @@ xkb_compose_table_iterator_new(struct xkb_compose_table *table);
void
xkb_compose_table_iterator_free(struct xkb_compose_table_iterator *iter);

/**
* Return the current entry of a compose table iterator.
*
* Once the iterator reaches the last entry, this function will keep
* returning this entry.
*
* @memberof xkb_compose_table_iterator
* @since 1.6.0
*/
struct xkb_compose_table_entry *
xkb_compose_table_iterator_current(struct xkb_compose_table_iterator *iter);

/**
* Get the next compose entry from a compose table iterator.
*
Expand Down
6 changes: 0 additions & 6 deletions src/compose/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ xkb_compose_table_iterator_free(struct xkb_compose_table_iterator *iter)
free(iter);
}

XKB_EXPORT struct xkb_compose_table_entry *
xkb_compose_table_iterator_current(struct xkb_compose_table_iterator *iter)
{
return &iter->entry;
}

XKB_EXPORT struct xkb_compose_table_entry *
xkb_compose_table_iterator_next(struct xkb_compose_table_iterator *iter)
{
Expand Down
6 changes: 3 additions & 3 deletions tools/compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ main(int argc, char *argv[])
}
}


struct xkb_compose_table_iterator *iter = xkb_compose_table_iterator_new(compose_table);
while (xkb_compose_table_iterator_next(iter)) {
print_compose_table_entry(xkb_compose_table_iterator_current(iter));
struct xkb_compose_table_entry *entry;
while ((entry = xkb_compose_table_iterator_next(iter))) {
print_compose_table_entry(entry);
}
xkb_compose_table_iterator_free(iter);

Expand Down
1 change: 0 additions & 1 deletion xkbcommon.map
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ global:
xkb_compose_table_entry_utf8;
xkb_compose_table_iterator_new;
xkb_compose_table_iterator_free;
xkb_compose_table_iterator_current;
xkb_compose_table_iterator_next;
// [FIXME] remove
xkb_compose_table_for_each;
Expand Down

0 comments on commit a27b66c

Please sign in to comment.