Skip to content

Commit 9963900

Browse files
Update power_grid_model_c/power_grid_model/include/power_grid_model/common/timer.hpp
Signed-off-by: Martijn Govers <[email protected]> Co-authored-by: Santiago Figueroa Manrique <[email protected]> Signed-off-by: Martijn Govers <[email protected]>
1 parent d4d8dd6 commit 9963900

File tree

1 file changed

+1
-1
lines changed
  • power_grid_model_c/power_grid_model/include/power_grid_model/common

1 file changed

+1
-1
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/common/timer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Timer {
2626
Timer(Logger& log, LogEvent code) : log_{&log}, code_{code}, start_{Clock::now()} {}
2727

2828
Timer(Timer const&) = delete;
29-
Timer(Timer&& other) noexcept : log_{other.log_}, code_{other.code_}, start_{other.start_} { other.log_ = nullptr; }
29+
Timer(Timer&& other) noexcept : log_{std::exchange(other.log_, nullptr)}, code_{other.code_}, start_{other.start_} {}
3030
Timer& operator=(Timer const&) = delete;
3131

3232
Timer& operator=(Timer&& timer) noexcept {

0 commit comments

Comments
 (0)