Skip to content

Commit

Permalink
cpp/*: use std::nullopt instead of {}
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Jan 17, 2024
1 parent 874d30c commit fb2e534
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cpp/include/pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace xph {
inline std::optional<T> pop()
{
if (!m_pool.size())
return {};
return std::nullopt;

auto front = m_pool.front();
m_pool.erase(m_pool.begin());
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/shared/obs/obs-event-sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::optional<decltype(fork())> play_sound(const char* filename)
errno = 0;
if (auto pid = fork(); pid < 0 || errno) {
perror("fork");
return {};
return std::nullopt;
} else if (pid == 0) {
execlp("play", "play", "-q", "--", ss.str().c_str(), NULL);
std::exit(EXIT_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/util/core/blank-screens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ std::optional<int> force_single_instance(const Options& options)
} else if (std::ofstream ofl(lock_file); ofl.is_open()) {
pid_t pid = getpid();
ofl << pid;
return {};
return std::nullopt;
} else {
return { EXIT_FAILURE };
}
Expand Down

0 comments on commit fb2e534

Please sign in to comment.