I have two maps, and am currently using a nested for loop to compare the keys of one map with the values of the other, and then placing the matching info into a new map. Is there a more efficient way to do this without a nested for loop?
if(groupDefinitionIds.size()>0){
//Connect the Program Id to the Group Definitions Id (Group Definition Id key, program Id value)
for(Id assignId: groupAssignmentIds.keyset()){
for(Id groupDefId: groupDefinitionIds.keyset()){
if(assignId == groupAssignmentIds.get(groupDefId)){
groupProgramIds.put(groupDefId, groupAssignmentIds.get(assignId));
}
}
}
keySet()
fromgroupDefinitionIds
, but you never actually access that map. Should it beif(assignId == groupDefinitionIds.get(groupDefId)){
?