Skip to content

Commit 1d225e8

Browse files
committed
_Do_rep: Remove unnecessary local variable _Cur_iter and replace its uses by _St._Cur
1 parent f252cab commit 1d225e8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

stl/inc/regex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,9 +3299,8 @@ bool _Matcher2<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Do_rep(_Node_rep* _Node,
32993299
_Loop_vals_t* _Psav = &_Loop_vals[_Node->_Loop_number];
33003300
int _Loop_idx_sav = _Psav->_Loop_idx;
33013301
_It* _Loop_iter_sav = static_cast<_It*>(_Psav->_Loop_iter);
3302-
_It _Cur_iter = _Tgt_state._Cur;
33033302

3304-
bool _Progress = _Init_idx == 0 || *_Loop_iter_sav != _Cur_iter;
3303+
bool _Progress = _Init_idx == 0 || *_Loop_iter_sav != _St._Cur;
33053304

33063305
if (0 <= _Node->_Max && _Node->_Max <= _Init_idx) {
33073306
_Matched0 = _Match_pat(_Node->_End_rep->_Next); // reps done, try tail
@@ -3310,7 +3309,7 @@ bool _Matcher2<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Do_rep(_Node_rep* _Node,
33103309
_Matched0 = _Match_pat(_Node->_End_rep->_Next); // empty, try tail
33113310
} else { // try another required match
33123311
_Psav->_Loop_idx = _Init_idx + 1;
3313-
_Psav->_Loop_iter = _STD addressof(_Cur_iter);
3312+
_Psav->_Loop_iter = _STD addressof(_St._Cur);
33143313
_Matched0 = _Match_pat(_Node->_Next);
33153314
}
33163315
} else if (_Longest) { // longest, try any number of repetitions
@@ -3321,7 +3320,7 @@ bool _Matcher2<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Do_rep(_Node_rep* _Node,
33213320
if (_Progress) {
33223321
_Tgt_state = _St;
33233322
_Psav->_Loop_idx = _Init_idx + 1;
3324-
_Psav->_Loop_iter = _STD addressof(_Cur_iter);
3323+
_Psav->_Loop_iter = _STD addressof(_St._Cur);
33253324

33263325
if (_Match_pat(_Node->_Next)) { // always call _Match_pat, even when _Matched0 is already true
33273326
_Matched0 = true;
@@ -3332,13 +3331,13 @@ bool _Matcher2<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Do_rep(_Node_rep* _Node,
33323331
if (!_Matched0 && _Progress) { // tail failed, try another rep
33333332
_Tgt_state = _St;
33343333
_Psav->_Loop_idx = _Init_idx + 1;
3335-
_Psav->_Loop_iter = _STD addressof(_Cur_iter);
3334+
_Psav->_Loop_iter = _STD addressof(_St._Cur);
33363335
_Matched0 = _Match_pat(_Node->_Next);
33373336
}
33383337
} else { // greedy, favor maximum number of reps
33393338
if (_Progress) { // try another rep
33403339
_Psav->_Loop_idx = _Init_idx + 1;
3341-
_Psav->_Loop_iter = _STD addressof(_Cur_iter);
3340+
_Psav->_Loop_iter = _STD addressof(_St._Cur);
33423341
_Matched0 = _Match_pat(_Node->_Next);
33433342
}
33443343

0 commit comments

Comments
 (0)