Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 3.0
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003818Doomseeker[All Projects] Cleanuppublic2020-06-07 07:182020-06-07 21:04
ReporterWubTheCaptain 
Assigned To 
PrioritynoneSeveritytrivialReproducibilityrandom
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version1.3.1 
Target VersionFixed in Version 
Summary0003818: Boolean expressions involving boolean constants (instead of expressing the boolean expression directly)
DescriptionElementary and pedantic about code style.
if (b == true) becomes if (b), and so on. This has been quite well followed, with only a few exceptions.

I will also agree something like bool ZandronumVersion::operator> (const ZandronumVersion &other) const is better written the way it is.
Steps To ReproduceThese are difficult to find with a text search and due to rarity, so I'll just point out one.
src/core/tests/testdatapaths.cpp:       } while (bEntryDoesExist == true);

Fortunately (or unfortunately), that's also part of the code that has rotten un(der)utilized.
Maybe this:
Quote from src/core/fileutils.cpp
bool FileUtils::containsPath(const QStringList &candidates, const QString &path)
{
        for (const QString &candidate : candidates)
        {
                if (QFileInfo(candidate) == QFileInfo(path))
                        return true;
        }
        return false;
}

Few more that I could find with grep -B 2 -A 2 -r 'return false' src/ | less.
Additional Informationhttps://clang.llvm.org/extra/clang-tidy/checks/readability-simplify-boolean-expr.html [^]
Attached Files

- Relationships

-  Notes
User avatar (0021392)
Pol M (developer)
2020-06-07 21:04

Yep. The src/core/fileutils.cpp example could use the <algorithm> std::find/std::find_if (as suggested by Qt himself as qFind seems deprecated)https://doc.qt.io/qt-5/qtalgorithms.html#qt-and-the-stl-algorithms [^]

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2020-06-07 07:18 WubTheCaptain New Issue
2020-06-07 07:19 WubTheCaptain Steps to Reproduce Updated View Revisions
2020-06-07 21:04 Pol M Note Added: 0021392
2020-06-07 21:04 Pol M Status new => confirmed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker