mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Improve coding style
This commit is contained in:
parent
acad35c5bc
commit
c41df9ffbd
147 changed files with 4454 additions and 2227 deletions
|
@ -63,7 +63,8 @@ void TrackerEntriesDialog::setTrackers(const QVector<BitTorrent::TrackerEntry> &
|
|||
int maxTier = -1;
|
||||
QHash<int, QString> tiers; // <tier, tracker URLs>
|
||||
|
||||
for (const BitTorrent::TrackerEntry &entry : trackers) {
|
||||
for (const BitTorrent::TrackerEntry &entry : trackers)
|
||||
{
|
||||
tiers[entry.tier()] += (entry.url() + '\n');
|
||||
maxTier = std::max(maxTier, entry.tier());
|
||||
}
|
||||
|
@ -85,10 +86,12 @@ QVector<BitTorrent::TrackerEntry> TrackerEntriesDialog::trackers() const
|
|||
entries.reserve(lines.size());
|
||||
|
||||
int tier = 0;
|
||||
for (QStringRef line : lines) {
|
||||
for (QStringRef line : lines)
|
||||
{
|
||||
line = line.trimmed();
|
||||
|
||||
if (line.isEmpty()) {
|
||||
if (line.isEmpty())
|
||||
{
|
||||
++tier;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue