mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
fix: sonarcloud code smells (#2623)
* fix: make variable a pointer-to-const * fix: use init-statement to reduce variable scope * fix: implicit conversion from long to int * fix: refactor to not nest more than 3 if|for|do|while|switch statements * fix: make tr_session::setSocketTos() const * fix: use array.prototype.some instead of a for loop * refactor: use nullptr instead of NULL * fix: oops
This commit is contained in:
@@ -393,17 +393,9 @@ export class Torrent extends EventTarget {
|
||||
|
||||
// maybe filter by labels...
|
||||
if (pass) {
|
||||
for (const l of labels) {
|
||||
let m = false;
|
||||
for (let j = 0; j < this.getLabels().length; j++) {
|
||||
if (l === this.getLabels()[j]) {
|
||||
m = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pass = pass && m;
|
||||
}
|
||||
// pass if this torrent has any of these labels
|
||||
const torrent_labels = this.getLabels();
|
||||
pass = labels.some((label) => torrent_labels.includes(label));
|
||||
}
|
||||
|
||||
// maybe filter by tracker...
|
||||
|
||||
Reference in New Issue
Block a user