[PATCH v1 1/3] libcamera: pipeline: virtual: Simplify error return
Jacopo Mondi
jacopo.mondi at ideasonboard.com
Mon Feb 3 18:31:33 CET 2025
Hi Barnabás
On Mon, Feb 03, 2025 at 10:43:24AM +0000, Barnabás Pőcze wrote:
> Just return an `std::unique_ptr` constructed from an empty
> initializer instead of doing a `reset()` on the existing
> `config` variable and returning that. This is simpler.
>
> Signed-off-by: Barnabás Pőcze <pobrn at protonmail.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
Thanks
j
> ---
> src/libcamera/pipeline/virtual/virtual.cpp | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp
> index fc46653f6..94c2bd91e 100644
> --- a/src/libcamera/pipeline/virtual/virtual.cpp
> +++ b/src/libcamera/pipeline/virtual/virtual.cpp
> @@ -232,8 +232,7 @@ PipelineHandlerVirtual::generateConfiguration(Camera *camera,
> default:
> LOG(Virtual, Error)
> << "Requested stream role not supported: " << role;
> - config.reset();
> - return config;
> + return {};
> }
>
> std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
> --
> 2.48.1
>
>
More information about the libcamera-devel
mailing list