[wp-trac] [WordPress Trac] #20004: Fix NULL and FALSE in WP_Object_Cache and make found/not-found unambiguous.
WordPress Trac
wp-trac at lists.automattic.com
Thu Feb 9 22:57:33 UTC 2012
#20004: Fix NULL and FALSE in WP_Object_Cache and make found/not-found unambiguous.
------------------------------------+------------------------------
Reporter: andy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cache | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Comment (by andy):
Nacin, thanks for the bit about the Notice. I had triggered a notice when
the code was written differently. You are correct. I will remove the extra
lines from the ticket.
As to ```wp_cache_exists()```, I am extremely reluctant to encourage
anyone to check existence separately from fetching the key. Atomicity is
important in high-concurrency environments like WordPress.com. If you were
to check ```exists```, then do a ```get```, what would be the expected
result? With ```found``` (internally called ```last_result```) there is
less room for ambiguity, race conditions, and errors.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20004#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list