Skip to content

Commit

Permalink
#363 Add a lambda expression in stream
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsanbagwan authored and Brutus5000 committed Sep 9, 2020
1 parent 64037c0 commit 348f5cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/faforever/api/map/MapService.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ public MapNameValidationResponse requestMapNameValidation(String mapName) {
Integer nextVersion = mapRepository.findOneByDisplayName(mapNameBuilder.getDisplayName())
.map(map -> map.getVersions().stream()
.mapToInt(MapVersion::getVersion)
.map(i -> i + 1)
.max()
.orElse(1))
.orElse(2);
.orElse(1);

return MapNameValidationResponse.builder()
.displayName(mapNameBuilder.getDisplayName())
Expand Down

0 comments on commit 348f5cb

Please sign in to comment.