gpt4 book ai didi

Java 迭代器无限循环

转载 作者:搜寻专家 更新时间:2023-11-01 01:21:13 24 4
gpt4 key购买 nike

<分区>

无法弄清楚为什么这是无限循环。

public void DLCCheck(IconSet iconSet) {
Log.d(TAG, "Got dlc check. Looking to see if we need to remove any notes from the current list.");
int foundCount = 0;
for(Iterator<Item> i = mItemList.iterator(); i.hasNext(); ) {
if(i instanceof NoteItem && ((NoteItem) i).getIconSet() == iconSet) {
i.remove();
foundCount++;
}
}
Log.d(TAG, "Finished searching. Found " + foundCount + "notes in the current list to delete.");
//notifyDataSetChanged();
//EventBus.getDefault().post(new MoveNoteListOut());
}

当 hasNext 返回 false 时,这不应该停止迭代吗?此列表中只有 6 个项目,但它会永远循环。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com