Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/modules/search/lib/Drupal/search/SearchQuery.php
Line 463: Unused local variable $total
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | drupal-core_remove-unused-variable-2080551-8.patch | 770 bytes | deneo |
| #7 | drupal-core_remove-unused-variable-2080551-7.patch | 769 bytes | deneo |
| #5 | 2080551-remove_unused_var_total.patch | 1.18 KB | beowulf1416 |
| #3 | 2080551-remove_unused_variables-7828157.patch | 613 bytes | beowulf1416 |
| #2 | 2080551-remove_unused_variables-7828156.patch | 609 bytes | beowulf1416 |
Comments
Comment #1
chertzogAs far as i know this $total is needed in this situation. So this would be a close works as designed.
Comment #2
beowulf1416 commentedreplaced foreach loop with for loop to remove unused local variable
Comment #3
beowulf1416 commentedfixed bug on patch
Comment #5
beowulf1416 commentedComment #6
areke commentedThe patch doesn't apply anymore, so it should be re-rolled.
Comment #7
deneo commentedComment #8
deneo commentedComment #10
areke commentedUsing a for loop is better in this case because of the fact that it removes the unused local variable. It also makes the code a little more readable. The latest patch applies cleanly and does what it's supposed to do so... RTBC.
Comment #11
areke commentedUsing a for loop is better in this case because of the fact that it removes the unused local variable. It also makes the code a little more readable. The latest patch applies cleanly and does what it's supposed to do so... RTBC.
Comment #12
webchickVery strange. Wonder why it was that way to begin with.
Committed and pushed to 8.x. Thanks!