From patchwork Sat Dec 9 02:22:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 19302 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0235CC31E9 for ; Sat, 9 Dec 2023 02:22:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D91762B30; Sat, 9 Dec 2023 03:22:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1702088561; bh=FmS/PL7f0qPrU43Mtczhnk8DEjNYg3opfi1zr9rRxKo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=V7ETOW31bSrtSNke1/0IAnQ4IC06nh5XyPLT+wMXVj2RoXE8UbkqXvBcyRhDCBOaU GvVllT+sDRior+6prB/mbQNkgCZxBzecqnVoCmjyoN5+wWDDC4FqWrqCjkEQrsvvjw NBj/FGaf2IKIcjInypIUNFEgljkB7CoeYblfq6cVip26slUfdAYGNE62w6j0CfWqur ohdBPt5q4tsnhKwOdjCHxlEWFKjcmGBs9Pe6dKBYHtWuSS3szAB/jKtYndYhDUHFwX 2SBRq8U2gAHqPTXPHWbQZ8YPE2rm6Sks5gmIKKRPm2gzNN3p64+6orHRvq7tFX6deo VLLke4pVFyRtw== Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48E6761D96 for ; Sat, 9 Dec 2023 03:22:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="CDPnXbsM"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1702088557; x=1702347757; bh=FmS/PL7f0qPrU43Mtczhnk8DEjNYg3opfi1zr9rRxKo=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=CDPnXbsMdd5qA4SGBLVvGgMNsYrz/SUTzE/RME6qyb1vcVX1S1b1+ZCIDoG4Bz4zt rpj55GGp1XMu2Eu02eLiDvZrpw+Rn5s/PEtgJt4QRVf3w/XSEgXElGo2xhfev2Q20l RUNgDB9UQ62NKLPDGsRGt0R9p2edmK5NAbFNTX3qzL+4Vj+t3ta57iJHSn4G50KLZs qG3msVrUo+iPXOaCYngTxyhSoKVObsrnPH1XGdSEANq/TpbQ8AjwmV5AC8HHffvOGf AsqXVKkYbhZ5uwJ3+ojbUwdXwKoPqg2oHeRKqyWq1iZ3LY2JVFEVXMxJi8IU6ilV1N OTpgIF7ogZRCQ== Date: Sat, 09 Dec 2023 02:22:28 +0000 To: libcamera-devel@lists.libcamera.org Message-ID: <20231209022227.595197-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] libcamera: framebuffer_allocator: Remove unnecessary `clear()` X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- 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;