Skip to content

Commit 4d47642

Browse files
committed
Fix wrong std::move usage
1 parent 9086e87 commit 4d47642

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dsf/mobility/Agent.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "Agent.hpp"
22

3+
#include <utility>
4+
35
namespace dsf::mobility {
46
Agent::Agent(std::time_t const& spawnTime,
57
std::optional<Id> itineraryId,
@@ -31,7 +33,7 @@ namespace dsf::mobility {
3133
void Agent::setStreetId(std::optional<Id> streetId) {
3234
if (!streetId.has_value()) {
3335
assert(m_nextStreetId.has_value());
34-
m_streetId = std::move(m_nextStreetId);
36+
m_streetId = std::exchange(m_nextStreetId, std::nullopt);
3537
return;
3638
}
3739
assert(m_nextStreetId.has_value() ? streetId == m_nextStreetId.value() : true);

0 commit comments

Comments
 (0)