{"id":22392,"url":"https://patchwork.libcamera.org/api/1.1/patches/22392/?format=json","web_url":"https://patchwork.libcamera.org/patch/22392/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241218083610.2397879-2-naush@raspberrypi.com>","date":"2024-12-18T08:34:18","name":"[v2,1/4] ipa: rpi: Use r-value references in the set()/setLocked() functions","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"d237d1f42ed2e212fdd602dc3a771d1545b22150","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22392/mbox/","series":[{"id":4910,"url":"https://patchwork.libcamera.org/api/1.1/series/4910/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4910","date":"2024-12-18T08:34:17","name":"Raspberry Pi: Various changes","version":2,"mbox":"https://patchwork.libcamera.org/series/4910/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22392/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22392/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3C788C3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Dec 2024 08:36:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2B0368094;\n\tWed, 18 Dec 2024 09:36:19 +0100 (CET)","from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B22F067F24\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Dec 2024 09:36:17 +0100 (CET)","by mail-wr1-x431.google.com with SMTP id\n\tffacd0b85a97d-387897fae5dso490683f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Dec 2024 00:36:17 -0800 (PST)","from NAUSH-P-DELL.pitowers.org ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-388c804a2f9sm13585781f8f.77.2024.12.18.00.36.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Dec 2024 00:36:16 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"eJguW1xJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1734510977; x=1735115777;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=B7RQnbyjyrsg/0lgDdzviLQ9dDzroinzgu5Rz/x5ULU=;\n\tb=eJguW1xJN6cJLtis5AXXpin4VmpEBGPzAEy6C5ZOOqjk2uCv/SkBi9nVNBlIyzXVZM\n\tICQMpMjxhZfuNkmL39vxqPnVuTdcxSQAdSJA4jX1l7gCe/4Ddk7c/Ag7IZbVsd6khG2i\n\tb6v3dFKtQJU1KfZza015a7a6Ywg6Rw+xewEDG8yxXcHv5usikgxOoXTZdP+iu9Qcm/BO\n\tDFwKpXqCxcnZWl7fENG/bUakFrBe2irAesxnZ8kaQ+cKmWok/sILFwDc+N/KsvfocxXP\n\tLYmMxMffb39OC/yHbmnSs6uJwy9HqS/1ePpWZWUg2WNaiMhyxTgbgzcdW4YZPgs9s/S7\n\tfTDQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1734510977; x=1735115777;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=B7RQnbyjyrsg/0lgDdzviLQ9dDzroinzgu5Rz/x5ULU=;\n\tb=VhB4IkV4dyEZhEXiVG/2yccUMZfptJl1zBraiupJF+XyKg7nb/YTnRhZzcqWRVJcyD\n\tHF+cJI2RIujHurYGYiLs3mN07l0wA5uVcjRtM09BVuomJsoDfGFtcbfJihI0jUB08lLl\n\tTJHZbJBqsToFe7W5syWr+DdeG0jLR+3OB0Mgrsw7VNn5fTrKkRFqB5cPPpfCBe/EyB8Z\n\tRvqoY2wD9AdG1RqkUOXllfCT80VAlop/PwdBWXD/Oeu3YNaPGjrHyqmzPGF7bSFglsxD\n\tbfaJmSZmBj98ULTqP4An5YCUZOn++WhC+MCPljtFB8xVhuXipeOysys4dFN5Xyi0V7/m\n\tb8Pg==","X-Gm-Message-State":"AOJu0YxvgNmAaTwXq3uT7IkKwWS9ISH8ZNyCRBDJsZuDLasNizA82HSp\n\tCGeR3Ora34AZI2pWUhZnAOd9Er0FG6cMFkErVrS2531ECwJf+rd7qilNqJSlTEu649SEaGYIre7\n\tA","X-Gm-Gg":"ASbGncvEKJQNZkBRONQF+OYoj1eBgzxqeQ/QM69NFDnVn49FP7/rWNxUhQX6GhK4tho\n\tXpnl/TKr6hOvx8STK+v1N/he3B58gAtnylWYRn+rsgDMFKrGnfVgXfredHZ50kC3YTX9VusRbMJ\n\t0TbzsHtklu5PeWjY2/4lv+13tOLFvy+IyaPpEUQbaL1EZK39Z5+Ptd0v5tF3O/LUuD+PFc764gS\n\tu+BcAnZccO1MJkXQV8tuCTWRh/4ItiCVFlhyyCzG/lIlYah2Aq/CL7srvh7+43wyZUzLxJIPPP/","X-Google-Smtp-Source":"AGHT+IHmsmojrh1Y1bPisKNHTBIxow3jokfYri9mrX1mlBb06DzbuLXfCIVlG5TaD8emM+C1JG1K+w==","X-Received":"by 2002:a05:600c:19d0:b0:434:f537:f9c1 with SMTP id\n\t5b1f17b1804b1-4365540f09bmr6307445e9.9.1734510976944; \n\tWed, 18 Dec 2024 00:36:16 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v2 1/4] ipa: rpi: Use r-value references in the\n\tset()/setLocked() functions","Date":"Wed, 18 Dec 2024 08:34:18 +0000","Message-ID":"<20241218083610.2397879-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20241218083610.2397879-1-naush@raspberrypi.com>","References":"<20241218083610.2397879-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Use an r-value reference in set() and setLocked(), allowing more\nefficient metadata handling with std::forward and std::move if needed.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rpi/controller/metadata.h | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)","diff":"diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h\nindex b4650d25170f..b884490918c7 100644\n--- a/src/ipa/rpi/controller/metadata.h\n+++ b/src/ipa/rpi/controller/metadata.h\n@@ -12,6 +12,7 @@\n #include <map>\n #include <mutex>\n #include <string>\n+#include <utility>\n \n #include <libcamera/base/thread_annotations.h>\n \n@@ -36,10 +37,10 @@ public:\n \t}\n \n \ttemplate<typename T>\n-\tvoid set(std::string const &tag, T const &value)\n+\tvoid set(std::string const &tag, T &&value)\n \t{\n \t\tstd::scoped_lock lock(mutex_);\n-\t\tdata_[tag] = value;\n+\t\tdata_[tag] = std::forward<T>(value);\n \t}\n \n \ttemplate<typename T>\n@@ -104,10 +105,10 @@ public:\n \t}\n \n \ttemplate<typename T>\n-\tvoid setLocked(std::string const &tag, T const &value)\n+\tvoid setLocked(std::string const &tag, T &&value)\n \t{\n \t\t/* Use this only if you're holding the lock yourself. */\n-\t\tdata_[tag] = value;\n+\t\tdata_[tag] = std::forward<T>(value);\n \t}\n \n \t/*\n","prefixes":["v2","1/4"]}