[wp-trac] [WordPress Trac] #34488: REST API: Save some preg_match iterations

WordPress Trac noreply at wordpress.org
Thu Oct 29 19:30:43 UTC 2015


#34488: REST API: Save some preg_match iterations
-------------------------+-----------------------
 Reporter:  TobiasBg     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  4.4
Component:  REST API     |    Version:  trunk
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------
 In the `WP_REST_Server`, a `preg_match`
 [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/rest-api
 /class-wp-rest-server.php?rev=35353#L774 call] and an if-check can be
 moved one level of for-loops up.

 It doesn't depend on the `$handler` variable nor is it modified in the
 inner for-loop, so that this would save some `preg_match`/REGEXP
 iterations.

 Also see https://wordpress.slack.com/archives/core-
 restapi/p1446136013000935.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34488>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list