Skip to content

Commit 81ddc67

Browse files
mnoconSteveb-p
andauthored
Update docs/discounts/extend_discounts.md
Co-authored-by: Paweł Niedzielski <[email protected]>
1 parent 6742514 commit 81ddc67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/discounts/extend_discounts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ For performance reasons, it's recommended to:
9393

9494
- use variables only for lightweight calculations
9595
- use functions for resource-intensive calculations (for example, checking customer's order history)
96-
- implement caching (for example, in-memory) for function results to avoid redundant calculations within a single discount, if the function is used multiple times
96+
- implement caching (for example, in-memory) for function results to avoid redundant calculations when multiple discounts expressions might use the function
9797
- specify the most resource-intensive conditions as the last to evaluate. As all conditions must be met for the discount to apply, it's possible to skip evaluating them if the previous ones won't be met
9898

9999
In a production implementation, you should consider refactoring the `current_user_registration_date` variable into a `get_current_user_registration_date` function to avoid always loading the current user object and improve performance.

0 commit comments

Comments
 (0)