Skip to content
Snippets Groups Projects
Commit b659af91 authored by Stian Lyng's avatar Stian Lyng
Browse files

limit items to 5

parent 3190b8b2
No related branches found
No related tags found
No related merge requests found
......@@ -229,7 +229,13 @@ public class RecipeService {
Collections.shuffle(zeroMatchRecipes);
// Combine the commonRecipes and zeroMatchRecipes lists
commonRecipes.addAll(zeroMatchRecipes);
for (RecipeWithMatchCount zeroMatchRecipe : zeroMatchRecipes) {
if (commonRecipes.size() < 5) {
commonRecipes.add(zeroMatchRecipe);
} else {
break;
}
}
return commonRecipes;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment