atrsimilar_suffix

Versions
6.1
atrsimilar_suffix(&$tokens)

Remove identical suffix for performance improvements.

▾ 1 function calls atrsimilar_suffix()

atrsimilar_diff in atr/modules/atrsimilar/includes/atrsimilar.review.inc
Compute the differences between two strings.

Code

atr/modules/atrsimilar/includes/atrsimilar.review.inc, line 163

<?php
function atrsimilar_suffix(&$tokens) {
  $suffix = '';
  while ($tokens[0] && $tokens[1] && end($tokens[0]) === end($tokens[1])) {
    $suffix = array_pop($tokens[0]) . $suffix;
    array_pop($tokens[1]);
  }

  return $suffix;
}
?>