diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-12-23 17:18:42 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-12-23 18:29:08 +0100 |
commit | 0374b80dd407d7b35654a01e3c7526b749d3464e (patch) | |
tree | d0e62aece120c764ad557501e60398317c7dc77a /src/other_tools/root_maps/fpath_git_map.cpp | |
parent | 1de5a178bc804209eeeb512023de1ce4d77eef42 (diff) | |
download | justbuild-0374b80dd407d7b35654a01e3c7526b749d3464e.tar.gz |
Just-MR: Remove wrong pass-by-reference when wrapping loggers
Passing the logger by reference would require the caller to be
kept alive. Also, being a shared_ptr, the logger can be passed
by value at almost no cost.
Diffstat (limited to 'src/other_tools/root_maps/fpath_git_map.cpp')
-rw-r--r-- | src/other_tools/root_maps/fpath_git_map.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp index 25218368..e50afeb4 100644 --- a/src/other_tools/root_maps/fpath_git_map.cpp +++ b/src/other_tools/root_maps/fpath_git_map.cpp @@ -31,7 +31,7 @@ auto CreateFilePathGitMap( auto const& key) { // setup wrapped logger auto wrapped_logger = std::make_shared<AsyncMapConsumerLogger>( - [&logger](auto const& msg, bool fatal) { + [logger](auto const& msg, bool fatal) { (*logger)( fmt::format("While getting repo root from path:\n{}", msg), fatal); @@ -91,7 +91,7 @@ auto CreateFilePathGitMap( // setup wrapped logger auto wrapped_logger = std::make_shared<AsyncMapConsumerLogger>( - [&logger](auto const& msg, bool fatal) { + [logger](auto const& msg, bool fatal) { (*logger)( fmt::format("While getting subtree from " "path:\n{}", |