Refactor: Simplify if-statement
Change-Id: I869b6a6e9f85422262dd7dbd3884534dcc7affb0
Showing
1 changed file
with
2 additions
and
6 deletions
| ... | @@ -191,11 +191,7 @@ class TransactionalContinuousResourceStore { | ... | @@ -191,11 +191,7 @@ class TransactionalContinuousResourceStore { |
| 191 | ImmutableList<ResourceAllocation> finalAllocations = Stream.concat(nonMatched.stream(), | 191 | ImmutableList<ResourceAllocation> finalAllocations = Stream.concat(nonMatched.stream(), |
| 192 | matched.stream()).collect(GuavaCollectors.toImmutableList()); | 192 | matched.stream()).collect(GuavaCollectors.toImmutableList()); |
| 193 | 193 | ||
| 194 | - if (!consumers.replace(resource.id(), oldAllocation, | 194 | + return consumers.replace(resource.id(), oldAllocation, |
| 195 | - new ContinuousResourceAllocation(oldAllocation.original(), finalAllocations))) { | 195 | + new ContinuousResourceAllocation(oldAllocation.original(), finalAllocations)); |
| 196 | - return false; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - return true; | ||
| 200 | } | 196 | } |
| 201 | } | 197 | } | ... | ... |
-
Please register or login to post a comment