Cleanup array.length checks and for() to forEach()

This commit is contained in:
djmaze 2020-07-28 12:35:41 +02:00
parent db5751cd00
commit 82bed1ed80
24 changed files with 135 additions and 169 deletions

View file

@ -58,7 +58,7 @@ class ContactsPopupView extends AbstractViewNext {
super();
const fFastClearEmptyListHelper = (list) => {
if (list && 0 < list.length) {
if (list && list.length) {
this.viewProperties.removeAll(list);
delegateRunOnDestroy(list);
}
@ -456,7 +456,7 @@ class ContactsPopupView extends AbstractViewNext {
let currentContact = this.currentContact(),
count = this.contacts().length;
if (0 < contacts.length) {
if (contacts.length) {
contacts.forEach(contact => {
if (currentContact && currentContact.idContact === contact.idContact) {
currentContact = null;
@ -481,7 +481,7 @@ class ContactsPopupView extends AbstractViewNext {
}
deleteSelectedContacts() {
if (0 < this.contactsCheckedOrSelected().length) {
if (this.contactsCheckedOrSelected().length) {
Remote.contactsDelete(this.deleteResponse.bind(this), this.contactsCheckedOrSelectedUids());
this.removeCheckedOrSelectedContactsFromList();