Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables

File /core/includes/menu.inc

Line 1935: Unused local variable $actions
Line 2059: Unused local variable $current
Line 2453: Unused local variable $key
Line 2483: Unused local variable $key
Line 2729: Unused local variable $masks
Line 2829: Unused local variable $masks
Line 3045: Unused local variable $key
Line 3336: Unused local variable $path

Comments

jan.stoeckler’s picture

Status: Active » Needs review
StatusFileSize
new2.75 KB

Here's hoping this one works on the first try.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

mrsinguyen’s picture

Status: Needs work » Needs review
StatusFileSize
new2.75 KB
ben.kyriakou’s picture

Status: Needs review » Reviewed & tested by the community

This patch applies and appears to make the changes listed. Thanks.

mcrittenden’s picture

Issue tags: -Needs reroll

Tags

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/includes/menu.inc
@@ -2483,7 +2481,7 @@ function menu_set_active_trail($new_trail = NULL) {
-      list($key, $curr) = each($tree);
+      list( , $curr) = each($tree);

@@ -2513,7 +2511,7 @@ function menu_set_active_trail($new_trail = NULL) {
-      list($key, $curr) = each($tree);
+      list( , $curr) = each($tree);

This pattern really does not help readability - let's not do this.

mrsinguyen’s picture

Title: Remove Unused local variable $actions from /core/includes/menu.inc » Remove Unused local variable from /core/includes/menu.inc
Status: Needs work » Needs review
StatusFileSize
new1.94 KB
areke’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch no longer applies; it should be rerolled.

dsdeiz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.37 KB

Re-roll.

Status: Needs review » Needs work

The last submitted patch, 10: drupal-2081133-10-remove-unused-local-variable.patch, failed testing.

dsdeiz’s picture

Status: Needs work » Needs review
deneo’s picture

Status: Needs review » Reviewed & tested by the community

The patch is good. Thank you!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.