[{"id":26941,"web_url":"https://patchwork.libcamera.org/comment/26941/","msgid":"<4llajyfa3ddsjkrjxwyk3hdu7wlcknwru57ianucmgvhvdk562@2xrhzdd4dua4>","date":"2023-04-26T16:21:43","subject":"Re: [libcamera-devel] [PATCH 10/13] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Wed, Apr 26, 2023 at 02:10:54PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Return a const std::string reference from RPi::Stream::name() to avoid\n> copying a string when not needed.\n\nMissing SoB\n\n> ---\n>  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 2 +-\n>  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index 3690667e9aa6..b7e4130f5e56 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -19,7 +19,7 @@ V4L2VideoDevice *Stream::dev() const\n>  \treturn dev_.get();\n>  }\n>\n> -std::string Stream::name() const\n> +const std::string &Stream::name() const\n>  {\n>  \treturn name_;\n>  }\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index 1aae674967e1..b8c74de35863 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -49,7 +49,7 @@ public:\n>  \t}\n>\n>  \tV4L2VideoDevice *dev() const;\n> -\tstd::string name() const;\n> +\tconst std::string &name() const;\n>  \tbool isImporter() const;\n>  \tvoid resetBuffers();\n>\n> --\n> 2.34.1\n>","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 1D990C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Apr 2023 16:21:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD4CA627E0;\n\tWed, 26 Apr 2023 18:21:47 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B78E7627D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Apr 2023 18:21:46 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4AFD6D8B;\n\tWed, 26 Apr 2023 18:21:35 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682526107;\n\tbh=3fCSHkObtBpvb1XKg5qRJ3TrDIb3XS28tlIMUMgJKFU=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=D69/jOvRt03mZEii/okJ7EQT2jlO4HsjIPeS8HG4C8HbvGBdWH0kGoO/Jf3jowP1v\n\tms/diUPPPyLc+Zy2pskRaloBmj/Gvzmd9x/GtyVxyrsl5Njno1ld50pZCsclxq9dOg\n\tCWhoW+FOurfVTW8Ne4LOk8FNHEtR90eYjva79ITb3DuoIx9p3GXMBX4z4NeiCmhhKs\n\tOsJrRtwmzMav/RJBUStP0OIROeDC6/uBOpShv4uCoYa1ftURqXpiYNm8tZwwbYS2jc\n\tNqJ2I2vmssWyU0fEYrPnoNSc07p2+GKvgqZdZjOmJ8cp6noIH8P4MwYpqV4wWvZFtj\n\tyZt3NBCsLSafg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1682526095;\n\tbh=3fCSHkObtBpvb1XKg5qRJ3TrDIb3XS28tlIMUMgJKFU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=N++6eLmSSiG39NWKC2T6he66JpWnwM/UuNyVnMW82OL+yhIU9aeuA8LHkrF7X2KD6\n\tcedQJ1e+18HavondJ0h5IsdSUgYy31Me2w2EE+mZ4DpUYtQeXbx0mqd84Fh3mIrnbh\n\ty3oWB9AWi5X5zECYY/bCMbBbtoRy16BV7Zy270fI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"N++6eLmS\"; dkim-atps=neutral","Date":"Wed, 26 Apr 2023 18:21:43 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<4llajyfa3ddsjkrjxwyk3hdu7wlcknwru57ianucmgvhvdk562@2xrhzdd4dua4>","References":"<20230426131057.21550-1-naush@raspberrypi.com>\n\t<20230426131057.21550-11-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230426131057.21550-11-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 10/13] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]