Compute value earlier and reuse it

This commit is contained in:
Dmitry-Me 2017-09-28 23:41:29 +03:00
parent 7308901add
commit 9fdfada4b5
1 changed files with 7 additions and 11 deletions

View File

@ -202,9 +202,8 @@ void CheckIO::checkFileUsage()
operation = Filepointer::OPEN;
} else if ((tok->str() == "rewind" || tok->str() == "fseek" || tok->str() == "fsetpos" || tok->str() == "fflush") ||
(windows && tok->str() == "_fseeki64")) {
if (printPortability && tok->str() == "fflush") {
fileTok = tok->tokAt(2);
if (fileTok) {
if (printPortability && fileTok && tok->str() == "fflush") {
if (fileTok->str() == "stdin")
fflushOnInputStreamError(tok, fileTok->str());
else {
@ -213,9 +212,6 @@ void CheckIO::checkFileUsage()
fflushOnInputStreamError(tok, fileTok->str());
}
}
}
fileTok = tok->tokAt(2);
operation = Filepointer::POSITIONING;
} else if (tok->str() == "fgetc" || tok->str() == "fgetwc" ||
tok->str() == "fgets" || tok->str() == "fgetws" || tok->str() == "fread" ||