From ee9eef1fa8710bd95098282273b0c65262909a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 18 Feb 2022 14:58:43 +0100 Subject: [PATCH] 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. --- AK/DisjointChunks.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AK/DisjointChunks.h b/AK/DisjointChunks.h index 9d7d5588b9..625b97554c 100644 --- a/AK/DisjointChunks.h +++ b/AK/DisjointChunks.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, Ali Mohammad Pur + * Copyright (c) 2022, kleines Filmröllchen * * 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); }