Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string TimePeriod::toString() const
- {
- ...
- if (_relativeTime <= 143)
- os << ((int)_relativeTime + 1) * 5 << _(" minutes");
- else if (_relativeTime <= 167)
- os << 12 * 60 + ((int)_relativeTime - 143) *
- 30 << _(" minutes");
- else if (_relativeTime <= 196)
- os << (int)_relativeTime - 166 << _(" days");
- else if (_relativeTime <= 143)
- os << (int)_relativeTime - 192 << _(" weeks");
- ...
- }
- The (_relativeTime <= 143) check is repeated twice.
- This suspicious code was found in eibsuite project by PVS-Studio static code analyzer.
- Warning message is:
- V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. GSM gsm_sms_codec.cc 175
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement