Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106-v23-03
backend
Commits
b659af91
Commit
b659af91
authored
1 year ago
by
Stian Lyng
Browse files
Options
Downloads
Patches
Plain Diff
limit items to 5
parent
3190b8b2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ntnu/idatt2016/v233/SmartMat/service/RecipeService.java
+7
-1
7 additions, 1 deletion
...a/ntnu/idatt2016/v233/SmartMat/service/RecipeService.java
with
7 additions
and
1 deletion
src/main/java/ntnu/idatt2016/v233/SmartMat/service/RecipeService.java
+
7
−
1
View file @
b659af91
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment