From patchwork Thu May 15 12:00:10 2025 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: 23371 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 208F6C331E for ; Thu, 15 May 2025 12:00:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BF9BA68D73; Thu, 15 May 2025 14:00:27 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rIYl1I3E"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9090368C92 for ; Thu, 15 May 2025 14:00:18 +0200 (CEST) Received: from pb-laptop.local (185.221.142.248.nat.pool.zt.hu [185.221.142.248]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F61C1121; Thu, 15 May 2025 14:00:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1747310401; bh=82tyq6j3KwSy/Q4N6O2oal8z5jmNHJqniAzCsWeApZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIYl1I3EHi8xyUTtmKxZQSJm5TFJRE5370fnF0UYizIt6LwnXETi9ZiQ2QA4QXTQY FL0c2kMfrEGh1m63U03cUtsNM5uK7z9HSUcQe8V0bvMeKwrKLwZiGnaQleoGcKqD9B 60XvotfAFCuKG6SElTbyE2Ta1VARy7Q9v+5PHAN8= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [RFC PATCH v1 6/8] libcamera: ipa_data_serializer: Remove some vector `reserve()` calls Date: Thu, 15 May 2025 14:00:10 +0200 Message-ID: <20250515120012.3127231-7-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250515120012.3127231-1-barnabas.pocze@ideasonboard.com> References: <20250515120012.3127231-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" `appendPOD()` does a single insertion, so if only a single `appendPOD()` will be called on a vector before returning, then calling `reserve()` is not that useful, so remove it. Signed-off-by: Barnabás Pőcze Reviewed-by: Paul Elder --- include/libcamera/internal/ipa_data_serializer.h | 1 - src/libcamera/ipa_data_serializer.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index b4614f21d..b1fefba58 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -309,7 +309,6 @@ public: serialize(const Flags &data, [[maybe_unused]] ControlSerializer *cs = nullptr) { std::vector dataVec; - dataVec.reserve(sizeof(Flags)); appendPOD(dataVec, static_cast::Type>(data)); return { dataVec, {} }; diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index 2189a2466..0537f785b 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -196,7 +196,6 @@ IPADataSerializer::serialize(const type &data, \ [[maybe_unused]] ControlSerializer *cs) \ { \ std::vector dataVec; \ - dataVec.reserve(sizeof(type)); \ appendPOD(dataVec, data); \ \ return { dataVec, {} }; \