summaryrefslogtreecommitdiff
path: root/Kernel/Devices
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2020-12-24 11:23:12 -0700
committerAndreas Kling <kling@serenityos.org>2021-01-11 19:45:05 +0100
commit853cb8af5cb16080470b29f127b1d2664c4ca2c7 (patch)
treece9033935b9abb6b1901759880213e3da592b137 /Kernel/Devices
parentf99d1d3bd7d6f752c490c358217c360b7e0bda80 (diff)
downloadserenity-853cb8af5cb16080470b29f127b1d2664c4ca2c7.zip
DoublyLinkedList: Implement `find` in terms of `AK::find`
Problem: - The implementation of `find` is coupled to the implementation of `DoublyLinkedList`. - `append` and `prepend` are implemented multiple times so that r-value references can be moved from into the new node. This is probably not called very often because a pr-value or x-value needs to be used here. Solution: - Decouple the implementation of `find` from the class by using a generic `find` algorithm. - Make `append` and `prepend` be function templates so that they can have binding references which can be forwarded.
Diffstat (limited to 'Kernel/Devices')
-rw-r--r--Kernel/Devices/Device.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Devices/Device.h b/Kernel/Devices/Device.h
index 1ef8bcfa89..b97ed35b25 100644
--- a/Kernel/Devices/Device.h
+++ b/Kernel/Devices/Device.h
@@ -75,7 +75,7 @@ public:
{
ScopedSpinLock lock(m_requests_lock);
was_empty = m_requests.is_empty();
- m_requests.append(request);
+ m_requests.append(RefPtr<AsyncDeviceRequest>(request));
}
if (was_empty)
request->do_start({});