summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2014-03-24 11:49:24 +0100
committerMichael Hamann <michael@content-space.de>2014-03-24 11:49:24 +0100
commit4e54d7b336d15235b61c1e669a74a74e06c89ee4 (patch)
treeb572ca5d6168171f6f255e46973829087f5bb154
parent4afeda5d696662387050cb6451eabeaa7445e59b (diff)
parentc6568d42d53cab0d8fef498f00a3b9f30d7403ad (diff)
downloadrpg-4e54d7b336d15235b61c1e669a74a74e06c89ee4.tar.gz
rpg-4e54d7b336d15235b61c1e669a74a74e06c89ee4.tar.bz2
Merge pull request #608 from splitbrain/updateTuple_refactor
Refactor updateTuple()
-rw-r--r--inc/indexer.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index a167db47f..5ca2f0bb1 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1218,19 +1218,18 @@ class Doku_Indexer {
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
protected function updateTuple($line, $id, $count) {
- $newLine = $line;
- if ($newLine !== ''){
- $newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine);
+ if ($line != ''){
+ $line = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $line);
}
- $newLine = trim($newLine, ':');
+ $line = trim($line, ':');
if ($count) {
- if (strlen($newLine) > 0) {
- return "$id*$count:".$newLine;
+ if ($line) {
+ return "$id*$count:".$line;
} else {
- return "$id*$count".$newLine;
+ return "$id*$count";
}
}
- return $newLine;
+ return $line;
}
/**