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

Oliver Klee typo3-german-02 at oliverklee.de
Wed Aug 19 14:19:53 CEST 2009


Hi,

Rupert Germann schrieb:
> $result = FALSE;
> if (is_array($LOCKED_RECORDS)) {
>    if (isset($LOCKED_RECORDS[$table . ':' . $uid]))  {
>       $result = $LOCKED_RECORDS[$table . ':' . $uid];
>    }
> } else {
>    // try to find locked records
> 
>    if (isset($LOCKED_RECORDS[$table . ':' . $uid]))  {
>       $result = $LOCKED_RECORDS[$table . ':' . $uid];
>    }
> }
> return $result;

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.



Oliver


More information about the TYPO3-team-core mailing list