Skip to content

Commit

Permalink
Merge pull request #25 from syyyr/pom-prom
Browse files Browse the repository at this point in the history
Use std::exchange instead of pom prom
  • Loading branch information
fvacek authored Jun 25, 2024
2 parents 6b435f1 + b51591b commit a5e1a72
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libnecrolog/necrolog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <array>
#include <filesystem>
#include <iostream>
#include <utility>

#ifdef __unix
#include <unistd.h>
Expand Down Expand Up @@ -100,9 +101,7 @@ bool NecroLog::shouldLog(Level level, const LogContext &context)

NecroLog::MessageHandler NecroLog::setMessageHandler(NecroLog::MessageHandler h)
{
MessageHandler ret = globalOptions().messageHandler;
globalOptions().messageHandler = h;
return ret;
return std::exchange(globalOptions().messageHandler, h);
}

namespace {
Expand Down

0 comments on commit a5e1a72

Please sign in to comment.