Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#21422 closed enhancement (fixed)

Micro-optimization in admin-footer.php

Reported by: TobiasBg Owned by: nacin
Priority: normal Milestone: 3.5
Component: Administration Version: 3.3
Severity: trivial Keywords: has-patch commit
Cc: Focuses:

Description

After some work (related to the admin bar) on admin-footer.php in wp-admin a while ago ([18888], the latest change in the file), the file does some unnecessary stuff, like an implode() on a one-item array, that's constant and unchangable.

It's just minor, but still done on every page load in the Dashboard, so let's just micro-optimize it away.

The attached patch removes that unnecessary implode() and two local variables.

Attachments (1)

admin-footer-micro-optimization.patch (1.0 KB ) - added by TobiasBg 14 years ago.
Patch to remove unnecessary implode() call and two local variables

Download all attachments as: .zip

Change History (4)

@TobiasBg
14 years ago

Patch to remove unnecessary implode() call and two local variables

#1 @SergeyBiryukov
14 years ago

  • Component GeneralAdministration
  • Keywords commit added
  • Milestone Awaiting Review3.5
  • Severity normaltrivial

#2 @nacin
14 years ago

There used to be other members of the array here.

I don't really like "micro-optimization" arguments, but this can be argued for much simpler reasons: It improves code readability.

(And, often, code readability goes against what could be considered a "micro-optimization" — in those cases, readability should take precedence. In this case, they are on the same side.)

#3 @nacin
14 years ago

  • Owner set to nacin
  • Resolutionfixed
  • Status newclosed

In [21366]:

Improve code readability and execution in admin-footer by removing a now-unnecessary implode(). props TobiasBg, fixes #21422.

Note: See TracTickets for help on using tickets.