mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-10 14:22:16 +02:00
Use same style for optional and avoid double check
I did not know that `std::optional::value()` did checked access. And I still prefer a more explicit .has_value() over boolean conversion, but this seems to be the accepted way to do this.
This commit is contained in:
@@ -57,7 +57,7 @@ std::string create_logger_prefix(const fs::path& socket_path) {
|
||||
std::optional<fs::path> find_wineprefix() {
|
||||
std::optional<fs::path> dosdevices_dir =
|
||||
find_dominating_file("dosdevices", find_vst_plugin(), fs::is_directory);
|
||||
if (!dosdevices_dir.has_value()) {
|
||||
if (!dosdevices_dir) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ bp::environment set_wineprefix() {
|
||||
}
|
||||
|
||||
const auto wineprefix_path = find_wineprefix();
|
||||
if (wineprefix_path.has_value()) {
|
||||
if (wineprefix_path) {
|
||||
env["WINEPREFIX"] = wineprefix_path->string();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user