function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

Avoiding multiple sets and probably replace by set

Hello,

I have below loop where is loop across accounlist and create few set.

Loop{
populate set 1
populate Set 2
}
use set 1
use set 2

Is there a way to store both set in same map and use the map
like map.set1 ,map.set2
Set<String> setOne 			= new Set<String>();
        Map<String,Account> mapEmailAccount 	= new Map<String,Account>();
        List<Account> lstAccountToUpdate     = new List<Account>();
        for(Account oAccount: lAccounts){
            if(!somecondition){
                if(oAccount.Email!=null){
                    setOne.add(oAccount.Email);
                    mapEmailAccount.put(oAccount.Email,oAccount);
                }
                lstAccountToUpdate.add(oAccount);
            }
        }

 
Best Answer chosen by Ab
AbhinavAbhinav (Salesforce Developers) 
referencing this way map.set1 ,map.set2 wont be possible with map.