mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:07:44 +00:00
SinglyLinkedList: Implement find
in terms of AK::find
Problem: - The implementation of `find` is coupled to the implementation of `SinglyLinkedList`. Solution: - Decouple the implementation of `find` from the class by using a generic `find` algorithm.
This commit is contained in:
parent
853cb8af5c
commit
1b2364846f
7 changed files with 106 additions and 30 deletions
|
@ -266,7 +266,7 @@ void Track::set_note(int note, Switch switch_note)
|
|||
|
||||
void Track::sync_roll(int note)
|
||||
{
|
||||
auto it = m_roll_notes[note].find([&](auto& roll_note) { return roll_note.off_sample > m_time; });
|
||||
auto it = m_roll_notes[note].find_if([&](auto& roll_note) { return roll_note.off_sample > m_time; });
|
||||
if (it.is_end())
|
||||
m_roll_iters[note] = m_roll_notes[note].begin();
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue