Skip to content

Commit

Permalink
clean code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
stormer-wc committed Mar 31, 2024
1 parent 1c07d98 commit ec371c2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public CartItemService(CartItemRepository cartItemRepository, CartRepository car

public CartResponse getCartByUsername(String username) {
Optional<Cart> optionalCartResponse = cartRepository.getCartByUsername(username);
CartResponse cartResponse = new CartResponse();
new CartResponse();
CartResponse cartResponse;
if (optionalCartResponse.isPresent()) {
// get cart
cartResponse = optionalCartResponse.get().toResponse();
Expand Down

0 comments on commit ec371c2

Please sign in to comment.