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