Avoid an unnecessary serialize() call on get() requests, which makes it
faster and also happens to work around a nasty crash bug which is
causing lots of segfaults right now.
CAS semantics should be the same, if the caller handles a CAS token in
an opaque way and does not assume it is a string. I could only find one
caller of cas() in core and WMF deployed extensions, and that is
BagOStuff::mergeViaCas(), which does correctly handle CAS tokens of any
type.
Bug: 71724
Change-Id: I0b0b5f0157c005ec7f76210dfb8576c056314733
return false;
}
- $casToken = serialize( $this->bag[$key][0] );
+ $casToken = $this->bag[$key][0];
return $this->bag[$key][0];
}
* @return bool
*/
function cas( $casToken, $key, $value, $exptime = 0 ) {
- if ( serialize( $this->get( $key ) ) === $casToken ) {
+ if ( $this->get( $key ) === $casToken ) {
return $this->set( $key, $value, $exptime );
}