[TYPO3-core] RFC #11746: speed up function t3lib_BEfunc::isRecordLocked()

Rupert Germann rupi at gmx.li
Wed Aug 19 15:04:58 CEST 2009


Oliver Klee schrieb:
> I'd find the following code more readable:
> 
> if (!is_array($LOCKED_RECORDS)) {
>   $LOCKED_RECORDS = array();
> }
> if (isset($LOCKED_RECORDS[$table . ':' . $uid])) {
>   return $LOCKED_RECORDS[$table . ':' . $uid];
> }
> 
> // Now retrieves the non-cache hits.

possibly more readable but it will change the behaviour.
now a db query will be executed each time when
$LOCKED_RECORDS[$table . ':' . $uid] is FALSE.
This will be the case for almost all calls to this function (because 
it's quite unlikely that the same record is displayed more than once in 
a BE module).


greets
rupert


More information about the TYPO3-team-core mailing list