calendar/base/modules/utils/calEmailUtils.jsm
changeset 28932 1da9c365060718ffc88deb4d39b3930aeb02a1a7
parent 28816 f61f27a35d891c977792cfdd4b10d1031b5ec10d
child 29179 588fc64ebcb0946ba09005e4de0bea4019a27392
--- a/calendar/base/modules/utils/calEmailUtils.jsm
+++ b/calendar/base/modules/utils/calEmailUtils.jsm
@@ -48,19 +48,17 @@ var calemail = {
 
   /**
    * Iterates all email identities and calls the passed function with identity and account.
    * If the called function returns false, iteration is stopped.
    *
    * @param {Function} aFunc       The function to be called for each identity and account
    */
   iterateIdentities(aFunc) {
-    let accounts = MailServices.accounts.accounts;
-    for (let i = 0; i < accounts.length; ++i) {
-      let account = accounts.queryElementAt(i, Ci.nsIMsgAccount);
+    for (let account of MailServices.accounts.accounts) {
       let identities = account.identities;
       for (let j = 0; j < identities.length; ++j) {
         let identity = identities.queryElementAt(j, Ci.nsIMsgIdentity);
         if (!aFunc(identity, account)) {
           break;
         }
       }
     }