Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Story Points:0.1
-
Epic Link:
-
Sprint:DRP S18-4, DRP S18-5, DRP S18-6
-
Team:Data Release Production
Description
Running clang-tidy readability-implicit-bool-cast on src/detection/Footprint.cc revealed that the wrong overload of SchemaMapper::addMapping is called when given a string literal as the second argument.
We expect it to call Key<T> addMapping(Key<T> const& inputKey, std::string const& outputName, bool doReplace = true);, but instead it calls Key<T> addMapping(Key<T> const& inputKey, bool doReplace = false); because it prefers to cast to bool rather than create a std::string temporary.
I propose we add an overload taking char const*, make it primary and redirect the std::string const& overload to it.
Another alternative would be to find where it is called with a string literal and change it to a std::string.
Which I guess also limits the scope of the problem.