list_model.h: rename 'apply_first' to 'with_first'

Issue #4317
This commit is contained in:
Norman Feske 2023-10-28 12:30:40 +02:00 committed by Christian Helmuth
parent 0f686a774d
commit d7ee460704
2 changed files with 6 additions and 6 deletions

View File

@ -143,15 +143,15 @@ class Genode::List_model : Noncopyable
}
/**
* Apply functor 'fn' to the first element of the list model
* Call functor 'fn' with the first element of the list model
*
* Using this method combined with the 'Element::next' method, the list
* model can be traversed manually. This is handy in situations where
* the list-model elements are visited via recursive function calls
* Using this method combined with 'Element::next', the list model
* can be traversed manually. This is handy in situations where the
* list-model elements are visited via recursive function calls
* instead of a 'for_each' loop.
*/
template <typename FN>
void apply_first(FN const &fn) const
void with_first(FN const &fn) const
{
if (Element const *e = _elements.first())
fn(static_cast<ELEM const &>(*e));

View File

@ -79,7 +79,7 @@ class Decorator::Window_stack : public Window_base::Draw_behind_fn
Dirty_rect result = _dirty_rect;
_dirty_rect.flush([&] (Rect const &rect) {
_windows.apply_first([&] (Window_base const &first) {
_windows.with_first([&] (Window_base const &first) {
_draw_rec(canvas, &first, rect); }); });
return result;