diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2023-05-03 13:20:33 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-05-04 20:59:24 +0300 |
commit | fd29edccaecdc9efa31869ac9331795e5956992f (patch) | |
tree | 984e85791673b1c774053e2e755b51cf1503207e /src | |
parent | 503bebd0ed80886569629e7ce11d40fa28721c84 (diff) |
pipeline: raspberrypi: Make RPi::Stream::name() return const std::string &
Return a const std::string reference from RPi::Stream::name() to avoid
copying a string when not needed.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/rpi/common/rpi_stream.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp index 3690667e..b7e4130f 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp @@ -19,7 +19,7 @@ V4L2VideoDevice *Stream::dev() const return dev_.get(); } -std::string Stream::name() const +const std::string &Stream::name() const { return name_; } diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h index 1aae6749..b8c74de3 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h @@ -49,7 +49,7 @@ public: } V4L2VideoDevice *dev() const; - std::string name() const; + const std::string &name() const; bool isImporter() const; void resetBuffers(); |