libsaria: Rename List::last() -> List::end()

To better match C++ iterators.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-06-30 12:08:04 -04:00
parent e0074525f3
commit 250a8b9bfe
3 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ namespace libsaria
unsigned int size();
ListItem<T> *first();
ListItem<T> *last();
ListItem<T> *end();
void for_each_item(void (*)(T &, void *), void *);
ListItem<T> *find_item(bool (*)(T &, void *), void *);

View File

@ -65,7 +65,7 @@ namespace libsaria
void idle::cancel_all(void *data)
{
ListItem<IdleTask *> *it;
for (it = idle_queue.first(); it != idle_queue.last(); it = it->next()) {
for (it = idle_queue.first(); it != idle_queue.end(); it = it->next()) {
if (it->get_value()->should_cancel(data))
it = idle_queue.erase(it);
}

View File

@ -93,7 +93,7 @@ namespace libsaria
}
template <class T>
ListItem<T> *List<T>::last()
ListItem<T> *List<T>::end()
{
return &head;
}
@ -101,7 +101,7 @@ namespace libsaria
template <class T>
void List<T>::for_each_item(void (*func)(T &, void *), void *data)
{
for (ListItem<T> *it = first(); it != last(); it = it->next())
for (ListItem<T> *it = first(); it != end(); it = it->next())
func(it->value, data);
}
@ -109,7 +109,7 @@ namespace libsaria
ListItem<T> *List<T>::find_item(bool (*func)(T &, void *), void *data)
{
ListItem<T> *it;
for (it = first(); it != last(); it = it->next()) {
for (it = first(); it != end(); it = it->next()) {
if (func(it->value, data))
return it;
}