AK: Make DisjointChunk::append move the new chunk
Previously, although we were taking a moved chunk, we still copied it into our chunk list. This makes DisjointChunk compatible with containers that don't have a copy constructor but a move constructor.
This commit is contained in:
parent
6e5bf7ac6f
commit
ee9eef1fa8
Notes:
sideshowbarker
2024-07-17 18:11:44 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/ee9eef1fa8 Pull-request: https://github.com/SerenityOS/serenity/pull/12733
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -195,7 +196,7 @@ public:
|
|||
DisjointChunks& operator=(DisjointChunks&&) = default;
|
||||
DisjointChunks& operator=(DisjointChunks const&) = default;
|
||||
|
||||
void append(ChunkType&& chunk) { m_chunks.append(chunk); }
|
||||
void append(ChunkType&& chunk) { m_chunks.append(move(chunk)); }
|
||||
void extend(DisjointChunks&& chunks) { m_chunks.extend(move(chunks.m_chunks)); }
|
||||
void extend(DisjointChunks const& chunks) { m_chunks.extend(chunks.m_chunks); }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue