summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-05 22:15:25 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-05 22:15:25 +0000
commit39134585c3f7a3c02113fb844ffabe0c1398c937 (patch)
treea09e070a361030402ae9c8268dee720050d6a160 /inc/indexer.php
parentd072820d2d17a702aaa47a0dccb89cd50f982b98 (diff)
downloadrpg-39134585c3f7a3c02113fb844ffabe0c1398c937.tar.gz
rpg-39134585c3f7a3c02113fb844ffabe0c1398c937.tar.bz2
add some braces (just style, not E_ALL)
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 07f29b542..7c0b8bc18 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -304,15 +304,17 @@ class Doku_Indexer {
$addwords = true;
}
// test if value is already in the index
- if (isset($val_idx[$id]) && $val_idx[$id] <= 0)
+ if (isset($val_idx[$id]) && $val_idx[$id] <= 0){
$val_idx[$id] = 0;
- else // else add it
+ } else { // else add it
$val_idx[$id] = 1;
+ }
}
}
- if ($addwords)
+ if ($addwords) {
$this->saveIndex($metaname.'_w', '', $metawords);
+ }
$vals_changed = false;
foreach ($val_idx as $id => $action) {
if ($action == -1) {
@@ -1214,14 +1216,16 @@ class Doku_Indexer {
*/
protected function updateTuple($line, $id, $count) {
$newLine = $line;
- if ($newLine !== '')
+ if ($newLine !== ''){
$newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine);
+ }
$newLine = trim($newLine, ':');
if ($count) {
- if (strlen($newLine) > 0)
+ if (strlen($newLine) > 0) {
return "$id*$count:".$newLine;
- else
+ } else {
return "$id*$count".$newLine;
+ }
}
return $newLine;
}