summaryrefslogtreecommitdiff
path: root/Libraries/LibProtocol
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-16 19:36:15 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-16 21:58:17 +0100
commita6e69bda71440f40d6c9d289258a69c0942b90ba (patch)
tree7cc2c0f131f0812d020fb4bfc08a097935711f13 /Libraries/LibProtocol
parent9794e18a20e026f0a377c8bc90fe5eb9909dae8b (diff)
downloadserenity-a6e69bda71440f40d6c9d289258a69c0942b90ba.zip
AK: Add basic Traits for RefPtr
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^) It's unfortunate about the const_casts. We'll need to fix HashMap::get to play nice with non-const Traits<T>::PeekType at some point.
Diffstat (limited to 'Libraries/LibProtocol')
-rw-r--r--Libraries/LibProtocol/Client.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibProtocol/Client.cpp b/Libraries/LibProtocol/Client.cpp
index bf8a93aeaa..55c8754c07 100644
--- a/Libraries/LibProtocol/Client.cpp
+++ b/Libraries/LibProtocol/Client.cpp
@@ -74,7 +74,7 @@ void Client::handle(const Messages::ProtocolClient::DownloadFinished& message)
void Client::handle(const Messages::ProtocolClient::DownloadProgress& message)
{
- if (auto download = m_downloads.get(message.download_id()).value_or(nullptr)) {
+ if (auto download = const_cast<Download*>(m_downloads.get(message.download_id()).value_or(nullptr))) {
download->did_progress({}, message.total_size(), message.downloaded_size());
}
}