Adjustment for implementation of Token::insertToken() (#1194)
Three attributes are reset in this member function even if their values are stored in the same token object. Move a corresponding sanity check so that less assignments could be performed eventually. Link: https://trac.cppcheck.net/ticket/8532 Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
This commit is contained in:
parent
ca8e19c96d
commit
521e3495b7
|
@ -909,11 +909,12 @@ void Token::insertToken(const std::string &tokenStr, const std::string &original
|
|||
newToken->str(tokenStr);
|
||||
if (!originalNameStr.empty())
|
||||
newToken->originalName(originalNameStr);
|
||||
newToken->_linenr = _linenr;
|
||||
newToken->_fileIndex = _fileIndex;
|
||||
newToken->_progressValue = _progressValue;
|
||||
|
||||
if (newToken != this) {
|
||||
newToken->_linenr = _linenr;
|
||||
newToken->_fileIndex = _fileIndex;
|
||||
newToken->_progressValue = _progressValue;
|
||||
|
||||
if (prepend) {
|
||||
/*if (this->previous())*/ {
|
||||
newToken->previous(this->previous());
|
||||
|
|
Loading…
Reference in New Issue