Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecommendKit.removeOverNews这个方法写的有点问题 #21

Open
blue1255 opened this issue Jul 8, 2019 · 0 comments
Open

RecommendKit.removeOverNews这个方法写的有点问题 #21

blue1255 opened this issue Jul 8, 2019 · 0 comments

Comments

@blue1255
Copy link

blue1255 commented Jul 8, 2019

public static void removeOverNews(Set set, int N){
int i = 0;
Iterator ite = set.iterator();
while (ite.hasNext()){
if (i >= N){
ite.remove();
ite.next();
}else{
ite.next();
}
i++;
}
}

要把
if (i >= N){
ite.remove();
ite.next();
}
里边的这两名话交换一下位置,移除的结果才是正确的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant