From b1b798ef68ea84b02e986b8463442f3fad2ce269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 9 Dec 2023 02:22:28 +0000 Subject: libcamera: framebuffer_allocator: Remove unnecessary `clear()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vector in question is destroyed when the item in the `buffers_` map is destroyed as a result of the `erase()` call. A vector's destructor already does all the things that `clear()` does, so calling it earlier is not needed. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/framebuffer_allocator.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp index dabd9219..94389735 100644 --- a/src/libcamera/framebuffer_allocator.cpp +++ b/src/libcamera/framebuffer_allocator.cpp @@ -121,8 +121,6 @@ int FrameBufferAllocator::free(Stream *stream) if (iter == buffers_.end()) return -EINVAL; - std::vector> &buffers = iter->second; - buffers.clear(); buffers_.erase(iter); return 0; -- cgit v1.2.1