]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kv: RocksDBStore: fix compile warning
authorWanlong Gao <wanlong.gao@easystack.cn>
Wed, 29 Jun 2016 05:57:50 +0000 (13:57 +0800)
committerWanlong Gao <wanlong.gao@easystack.cn>
Wed, 29 Jun 2016 11:16:41 +0000 (19:16 +0800)
/git/ceph/src/kv/RocksDBStore.cc:700:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   if (valid())
   ^~
/git/ceph/src/kv/RocksDBStore.cc:702:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
     return dbiter->status().ok() ? 0 : -1;
     ^~~~~~

Signed-off-by: Wanlong Gao <wanlong.gao@easystack.cn>
src/kv/RocksDBStore.cc

index 826328ea32e48a385b8d6305c51f5823fb62d8c3..dbe569bf4b01fc25f3a3d16e82eb0ef995ea3db3 100644 (file)
@@ -691,15 +691,17 @@ bool RocksDBStore::RocksDBWholeSpaceIteratorImpl::valid()
 }
 int RocksDBStore::RocksDBWholeSpaceIteratorImpl::next()
 {
-  if (valid())
-  dbiter->Next();
+  if (valid()) {
+    dbiter->Next();
+  }
   return dbiter->status().ok() ? 0 : -1;
 }
 int RocksDBStore::RocksDBWholeSpaceIteratorImpl::prev()
 {
-  if (valid())
+  if (valid()) {
     dbiter->Prev();
-    return dbiter->status().ok() ? 0 : -1;
+  }
+  return dbiter->status().ok() ? 0 : -1;
 }
 string RocksDBStore::RocksDBWholeSpaceIteratorImpl::key()
 {