Commit 4fde489
authored
Refactor average rating calculation for user clarity and performance (#1406)
* refactor: rename calculate_average_rating to calculate_average_rating_for_user for clarity
* refactor: update calculate_average_rating_for_user to accept user_id as a parameter
* refactor: update calculate_average_rating_for_user to filter reviews by user_id
* refactor: optimize calculate_average_rating_for_user to improve readability and performance
* refactor: optimize calculate_average_rating_for_user to improve performance and readability1 parent 113330c commit 4fde489
File tree
2 files changed
+17
-11
lines changed- crates
- services/miscellaneous/src
- utils/application/src
2 files changed
+17
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
0 commit comments