package com.google.android.libraries.places.internal; import java.util.Iterator; import java.util.List; import java.util.Map; /* loaded from: classes2.dex */ final class zzaha implements Iterator { final zzahe zza; private int zzb = -1; private boolean zzc; private Iterator zzd; private final Iterator zza() { Map map; if (this.zzd == null) { map = this.zza.zzc; this.zzd = map.entrySet().iterator(); } return this.zzd; } @Override // java.util.Iterator public final boolean hasNext() { List list; Map map; int i = this.zzb + 1; list = this.zza.zzb; if (i < list.size()) { return true; } map = this.zza.zzc; return !map.isEmpty() && zza().hasNext(); } @Override // java.util.Iterator public final /* synthetic */ Object next() { List list; List list2; this.zzc = true; int i = this.zzb + 1; this.zzb = i; list = this.zza.zzb; if (i >= list.size()) { return (Map.Entry) zza().next(); } list2 = this.zza.zzb; return (Map.Entry) list2.get(this.zzb); } @Override // java.util.Iterator public final void remove() { List list; if (!this.zzc) { throw new IllegalStateException("remove() was called before next()"); } this.zzc = false; this.zza.zzn(); int i = this.zzb; list = this.zza.zzb; if (i >= list.size()) { zza().remove(); return; } zzahe zzaheVar = this.zza; int i2 = this.zzb; this.zzb = i2 - 1; zzaheVar.zzl(i2); } /* JADX INFO: Access modifiers changed from: package-private */ public /* synthetic */ zzaha(zzahe zzaheVar, zzagz zzagzVar) { this.zza = zzaheVar; } }