From patchwork Fri Dec 13 09:38:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22306 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 3E048C32EA for ; Fri, 13 Dec 2024 09:46:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7E64667EEE; Fri, 13 Dec 2024 10:46:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="S5WwIcMZ"; dkim-atps=neutral Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D16667EE0 for ; Fri, 13 Dec 2024 10:46:09 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436203f1203so1621075e9.2 for ; Fri, 13 Dec 2024 01:46:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1734083169; x=1734687969; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=idQKCBHzbaC+BEg4JRAyp9O26UUUljmI2CnjLqe3ocU=; b=S5WwIcMZ/WvWBi0DlAXcXbO0DoXwYC/zjrYKEwfnp9kwRkgnGkIw+ZYSLcYVGt8BHa jK4AtyIulpaVxn7ba08u5dzb05cRptsygobwcDRX9Yzo0d8ttsc7gC7Q6BHmV+9McI1p iaKRTfSMLHDGZEA35AVIc7z5HOoQhfW/P2nUeuKG0tK3jL5rNH7Ua5oyx0dANoduEEV9 jFsihPOuN5CgKr6heAEC+4u9py0kGHSSQzdh6VsRBXgd0ZqPGeeJ+pgjCi6AKSsUaQ+K o//Dqi/uflApvXOagcSffp06lB/Qmg0j/F1lSkmd2Y0TZnEhUthj80L4B6CQlEGJl4Sr wTew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734083169; x=1734687969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=idQKCBHzbaC+BEg4JRAyp9O26UUUljmI2CnjLqe3ocU=; b=d396kiqPVO9FUde1VkoZAAsLg1GLp5M5medeOfwkgd9QS1RGoW35WPjiY9axquCzwP Fc8+2FNwtaGetT2ZJp+YH3bhiRlwhe7DUtdjIS34XfgR9zRvDQ4P8RMzpslM7C4X9eWG WvWog15yvCSLvFLjSWcw+FK+oAWvRZr8ofzF3Scn8RlZoPPGNvCVkxMkz9uxWAK5UDhj NN8GQfVojgFdEbZzZbFxZ9Mwr9/T9gbzj2Sh7lYpTw5aihoUuwTx+fy1N/ebbEf65vY/ dqt9QvNKs+0c4AtL3GKQ1Xj7rumzuYcknJp09XZ7WVLLyUUm6dl9aK8Oiueen6LQ4P3x 78vw== X-Gm-Message-State: AOJu0YxJo6hiHo5y5eAGb/3iHc48QDnw0bCGEDKs1Px41e71gIRA9Aek XTSWHbmTWkDNrIC34NIyStDEScJN/0ham7I+v89t0hByaM9lAZGdktXYhR4ThVOCWoV1w41wF15 O X-Gm-Gg: ASbGnctnLCiYLw5kr9KtD+G3RHaF+KZNj/GCnHR6fOAUt+3eNmUQsetDQxCP4ONcEGi WDvUNN5fiUPKX1OAvMMosyMPFeIEHEmm/fbqS76tpQNkUCe3rA0xOFGUrdAITTMA9+kikqleySN i6ehrYNUdNM2W3Cogjj4+OqbR9PDVDhbATT/5EUISl+szyR0w4mJxjUYGwLPO8Z0xp9e40wil+g 0SHT9hTH2ATyXuudJgqHpMT/vrT/GMLr00xNMPPJiDc07S/S7/REghEjgOv5ZpkCuB74n6WZWxD X-Google-Smtp-Source: AGHT+IGZ2z8x2ufql5/63tDeg2CinB4a0Tr85AlsCnMvmlnYHu8EbMToaH4n6n1gTAC0piI10yFw5g== X-Received: by 2002:a05:600c:4ed3:b0:42c:c0d8:bf49 with SMTP id 5b1f17b1804b1-4362a9895eemr5579675e9.0.1734083168635; Fri, 13 Dec 2024 01:46:08 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4362557c502sm43989105e9.11.2024.12.13.01.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 01:46:08 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH 1/6] ipa: rpi: Use r-value references in the set()/setLocked() functions Date: Fri, 13 Dec 2024 09:38:24 +0000 Message-ID: <20241213094602.2083174-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241213094602.2083174-1-naush@raspberrypi.com> References: <20241213094602.2083174-1-naush@raspberrypi.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" Use an r-value reference in set() and setLocked(), allowing more efficient metadata handling with std::forward and std::move if needed. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/metadata.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h index b4650d25170f..eda4b59bca9a 100644 --- a/src/ipa/rpi/controller/metadata.h +++ b/src/ipa/rpi/controller/metadata.h @@ -36,10 +36,10 @@ public: } template - void set(std::string const &tag, T const &value) + void set(std::string const &tag, T &&value) { std::scoped_lock lock(mutex_); - data_[tag] = value; + data_[tag] = std::forward(value); } template @@ -104,10 +104,10 @@ public: } template - void setLocked(std::string const &tag, T const &value) + void setLocked(std::string const &tag, T &&value) { /* Use this only if you're holding the lock yourself. */ - data_[tag] = value; + data_[tag] = std::forward(value); } /*