[wp-trac] [WordPress Trac] #63022: Update cache.php - Improve function wp_cache_decr

WordPress Trac noreply at wordpress.org
Thu Feb 27 05:55:25 UTC 2025


#63022: Update cache.php - Improve function wp_cache_decr
-------------------------------------+------------------------------
 Reporter:  docjojo                  |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Cache API                |     Version:  6.7.2
 Severity:  normal                   |  Resolution:
 Keywords:  wp_cache_decr has-patch  |     Focuses:  performance
-------------------------------------+------------------------------

Comment (by ameliamoon):

 Replying to [ticket:63022 docjojo]:
 > Make the lines 519-549 in class-wp-object-cache.php obsolete by
 adjusting the function call to the function wp_cache_decr, line 252 in
 cache.php.
 >
 > Change
 >
 > `return $wp_object_cache->decr( $key, $offset, $group ); `
 > to
 > `return $wp_object_cache->incr( $key, ((int) $offset) * -1), $group );`
 >
 > because DECR by offset == INCR by (offset * -1)

 i have the same problem

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


More information about the wp-trac mailing list