Skip to content
Snippets Groups Projects

Resolve "Problem::getState(structure) doesn't care about structure"

2 files
+ 48
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -491,11 +491,16 @@ VectorComposite ProcessorMotion::getState(const StateStructure& _structure) cons
@@ -491,11 +491,16 @@ VectorComposite ProcessorMotion::getState(const StateStructure& _structure) cons
else
else
{
{
// remove states not requested
// remove states not requested by structure
for (const auto& pair_key_vec : state)
auto pair_key_vec_it = state.begin();
 
while (pair_key_vec_it != state.end())
{
{
if (_structure.find(pair_key_vec.first) == std::string::npos)
if (_structure.find(pair_key_vec_it->first) == std::string::npos)
state.erase(pair_key_vec.first);
pair_key_vec_it = state.erase(pair_key_vec_it);
 
 
else
 
pair_key_vec_it ++;
 
}
}
return state;
return state;
}
}
@@ -581,11 +586,16 @@ VectorComposite ProcessorMotion::getState(const TimeStamp& _ts, const StateStruc
@@ -581,11 +586,16 @@ VectorComposite ProcessorMotion::getState(const TimeStamp& _ts, const StateStruc
else
else
{
{
// remove states not requested
// remove states not requested by structure
for (const auto& pair_key_vec : state)
auto pair_key_vec_it = state.begin();
 
while (pair_key_vec_it != state.end())
{
{
if (_structure.find(pair_key_vec.first) == std::string::npos)
if (_structure.find(pair_key_vec_it->first) == std::string::npos)
state.erase(pair_key_vec.first);
pair_key_vec_it = state.erase(pair_key_vec_it);
 
 
else
 
pair_key_vec_it ++;
 
}
}
return state;
return state;
}
}
Loading