mirror of https://gitee.com/bigwinds/arangodb
fix issues reported by cppcheck (#2660)
This commit is contained in:
parent
31985fc521
commit
017219ace6
|
@ -40,7 +40,7 @@ namespace arangodb {
|
|||
class RocksDBKey {
|
||||
public:
|
||||
RocksDBKey() = delete;
|
||||
RocksDBKey(rocksdb::Slice slice)
|
||||
explicit RocksDBKey(rocksdb::Slice slice)
|
||||
: _type(static_cast<RocksDBEntryType>(slice.data()[0])),
|
||||
_buffer(slice.data(), slice.size()) {}
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@ arangodb::Result Indexes::getAll(arangodb::LogicalCollection const* collection,
|
|||
if (ServerState::instance()->isCoordinator()) {
|
||||
std::string const databaseName(collection->dbName());
|
||||
std::string const cid = collection->cid_as_string();
|
||||
std::string const collectionName(collection->name());
|
||||
|
||||
auto c = ClusterInfo::instance()->getCollection(databaseName, cid);
|
||||
c->getIndexesVPack(tmp, withFigures, false);
|
||||
|
@ -126,7 +125,6 @@ arangodb::Result Indexes::getAll(arangodb::LogicalCollection const* collection,
|
|||
|
||||
// READ-LOCK start
|
||||
trx.lockRead();
|
||||
std::string const collectionName(collection->name());
|
||||
|
||||
// get list of indexes
|
||||
auto indexes = collection->getIndexes();
|
||||
|
@ -237,7 +235,7 @@ static Result EnsureIndexLocal(arangodb::LogicalCollection* collection,
|
|||
// TODO Encapsulate in try{}catch(){} instead of errno()
|
||||
try {
|
||||
idx = collection->createIndex(&trx, definition, created);
|
||||
} catch (arangodb::basics::Exception e) {
|
||||
} catch (arangodb::basics::Exception const& e) {
|
||||
return Result(e.code());
|
||||
}
|
||||
if (idx == nullptr) {
|
||||
|
@ -365,7 +363,6 @@ Result Indexes::ensureIndex(arangodb::LogicalCollection* collection,
|
|||
|
||||
// ensure an index, coordinator case
|
||||
if (ServerState::instance()->isCoordinator()) {
|
||||
std::string errorMsg;
|
||||
VPackBuilder tmp;
|
||||
#ifdef USE_ENTERPRISE
|
||||
Result res =
|
||||
|
|
Loading…
Reference in New Issue