Calculate checksum only if necessary (#6129)
This commit is contained in:
parent
5260d0dd65
commit
4940da06c0
|
@ -360,10 +360,12 @@ bool CppCheck::checkFile(const std::string &code, const char FileName[], std::se
|
||||||
result = _tokenizer.tokenize(istr, FileName, cfg);
|
result = _tokenizer.tokenize(istr, FileName, cfg);
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
|
|
||||||
unsigned long long checksum = _tokenizer.list.calculateChecksum();
|
if (_settings._force || _settings._maxConfigs > 1) {
|
||||||
if (checksums.find(checksum) != checksums.end())
|
unsigned long long checksum = _tokenizer.list.calculateChecksum();
|
||||||
return false;
|
if (checksums.find(checksum) != checksums.end())
|
||||||
checksums.insert(checksum);
|
return false;
|
||||||
|
checksums.insert(checksum);
|
||||||
|
}
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// File had syntax errors, abort
|
// File had syntax errors, abort
|
||||||
|
|
Loading…
Reference in New Issue