Skip to content

Commit

Permalink
Drop redundant string copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed Jan 9, 2025
1 parent 83dd141 commit 058eede
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spicy/toolchain/src/config.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@ void Configuration::init(bool use_build_directory) {

std::vector<std::string> library_paths;

if ( auto path = std::getenv("SPICY_PATH") ) {
library_paths =
hilti::util::transform(hilti::util::split(path, ":"), [](auto s) { return std::string(std::move(s)); });
}
else {
if ( auto path = std::getenv("SPICY_PATH") )
library_paths = hilti::util::split(path, ":");

else
library_paths = flatten({".", prefix("${SPICY_CONFIG_LIBRARY_DIRS}", "", installation_tag)});
}

spicy_library_paths =
hilti::util::transform(library_paths, [](const auto& s) { return hilti::rt::filesystem::path(s); });
Expand Down

0 comments on commit 058eede

Please sign in to comment.