Skip to content

Commit 04d27ba

Browse files
committed
One more state to position change
1 parent 0bbdee6 commit 04d27ba

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/app/AttributePathExpandIterator.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class AttributePathExpandIterator
9999
ConcreteAttributePath mOutputPath;
100100
};
101101

102-
AttributePathExpandIterator(DataModel::Provider * dataModel, Position & position) : mDataModelProvider(dataModel), mPosition(position)
102+
AttributePathExpandIterator(DataModel::Provider * dataModel, Position & position) :
103+
mDataModelProvider(dataModel), mPosition(position)
103104
{}
104105

105106
// This class may not be copied. A new one should be created when needed and they
@@ -184,24 +185,24 @@ class AttributePathExpandIterator
184185
class PeekAttributePathExpandIterator
185186
{
186187
public:
187-
PeekAttributePathExpandIterator(DataModel::Provider * dataModel, AttributePathExpandIterator::Position & state) :
188-
mAttributePathExpandIterator(dataModel, state), mStateTarget(state), mOldState(state)
188+
PeekAttributePathExpandIterator(DataModel::Provider * dataModel, AttributePathExpandIterator::Position & position) :
189+
mAttributePathExpandIterator(dataModel, position), mPositionTarget(position), mOldPosition(position)
189190
{}
190-
~PeekAttributePathExpandIterator() { mStateTarget = mOldState; }
191+
~PeekAttributePathExpandIterator() { mPositionTarget = mOldPosition; }
191192

192193
bool Next(ConcreteAttributePath & path)
193194
{
194-
mOldState = mStateTarget;
195+
mOldPosition = mPositionTarget;
195196
return mAttributePathExpandIterator.Next(path);
196197
}
197198

198199
/// Marks the current iteration completed (so peek does not actually roll back)
199-
void MarkCompleted() { mOldState = mStateTarget; }
200+
void MarkCompleted() { mOldPosition = mPositionTarget; }
200201

201202
private:
202203
AttributePathExpandIterator mAttributePathExpandIterator;
203-
AttributePathExpandIterator::Position & mStateTarget;
204-
AttributePathExpandIterator::Position mOldState;
204+
AttributePathExpandIterator::Position & mPositionTarget;
205+
AttributePathExpandIterator::Position mOldPosition;
205206
};
206207

207208
} // namespace app

0 commit comments

Comments
 (0)