[libcamera-devel] [PATCH 1/5] libcamera: base: log: Remove unnecessary local variable
paul.elder at ideasonboard.com
paul.elder at ideasonboard.com
Tue May 31 05:19:05 CEST 2022
Hi Laurent,
On Thu, May 26, 2022 at 01:24:59AM +0300, Laurent Pinchart via libcamera-devel wrote:
> The output local variable in Logger::logSetTarget() isn't necessary.
> Remove it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
> src/libcamera/base/log.cpp | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp
> index 64813b6607c5..df84ba4e8328 100644
> --- a/src/libcamera/base/log.cpp
> +++ b/src/libcamera/base/log.cpp
> @@ -477,15 +477,11 @@ int Logger::logSetStream(std::ostream *stream)
> */
> int Logger::logSetTarget(enum LoggingTarget target)
> {
> - std::shared_ptr<LogOutput> output;
> -
> switch (target) {
> case LoggingTargetSyslog:
> - output = std::make_shared<LogOutput>();
> - std::atomic_store(&output_, output);
> + std::atomic_store(&output_, std::make_shared<LogOutput>());
> break;
> case LoggingTargetNone:
> - output = nullptr;
> std::atomic_store(&output_, std::shared_ptr<LogOutput>());
> break;
> default:
More information about the libcamera-devel
mailing list