[wp-trac] [WordPress Trac] #56092: Unnecessary optimization in wp_get_ready_cron_jobs()

WordPress Trac noreply at wordpress.org
Fri Sep 9 01:52:07 UTC 2022


#56092: Unnecessary optimization in wp_get_ready_cron_jobs()
------------------------------+----------------------------
 Reporter:  lev0              |       Owner:  davidbaumwald
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  6.1
Component:  Cron API          |     Version:  5.1
 Severity:  trivial           |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  performance
------------------------------+----------------------------
Changes (by peterwilsoncc):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54110" 54110]:
 {{{
 #!CommitTicketReference repository="" revision="54110"
 Cron API: Remove unnecessary optimization getting ready events.

 Remove the check for future events prior iterating the array of crons in
 `wp_get_ready_cron_jobs()`. If there are no ready events, the `foreach`
 loop will break on the first iteration so the optimization is not
 required.

 As WordPress Core adds a number of events by default, accounting for an
 empty array is not required in most instances.

 Props lev0, jrf, SergeyBiryukov.
 Fixes #56092.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56092#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list