Improved: Refactor boolean returns for ShoppingCart methods
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.
Thanks Suraj Khurana and Jacques Le Roux for the review.
@@ -1965,10 +1965,7 @@ public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
try {
GenericValue giftCertSettings = getGiftCertSettingFromStore(delegator);
if (giftCertSettings != null) {
- if ("Y".equals(giftCertSettings.getString("requirePinCode"))) {
- return true;
- }
- return false;
+ return "Y".equals(giftCertSettings.getString("requirePinCode"));
}
Debug.logWarning("No product store gift certificate settings found for store [" + getProductStoreId() + "]",
module);
