mirror of https://gitee.com/bigwinds/arangodb
pacify cppcheck
This commit is contained in:
parent
46df140751
commit
d65662fb62
|
@ -51,8 +51,7 @@ class ApplicationAgency : virtual public arangodb::rest::ApplicationFeature {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ApplicationAgency(ApplicationEndpointServer*);
|
explicit ApplicationAgency(ApplicationEndpointServer*);
|
||||||
|
|
||||||
|
|
||||||
~ApplicationAgency();
|
~ApplicationAgency();
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ struct AgencyTransaction {
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief shortcut to create a transaction with one operation
|
/// @brief shortcut to create a transaction with one operation
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
AgencyTransaction(AgencyOperation operation) {
|
explicit AgencyTransaction(AgencyOperation const& operation) {
|
||||||
operations.push_back(operation);
|
operations.push_back(operation);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -375,11 +375,10 @@ bool ApplicationCluster::open() {
|
||||||
AgencyComm comm;
|
AgencyComm comm;
|
||||||
AgencyCommResult result;
|
AgencyCommResult result;
|
||||||
|
|
||||||
bool success;
|
|
||||||
do {
|
do {
|
||||||
AgencyCommLocker locker("Current", "WRITE");
|
AgencyCommLocker locker("Current", "WRITE");
|
||||||
|
|
||||||
success = locker.successful();
|
bool success = locker.successful();
|
||||||
if (success) {
|
if (success) {
|
||||||
VPackBuilder builder;
|
VPackBuilder builder;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -670,6 +670,7 @@ int createDocumentOnCoordinator(
|
||||||
}
|
}
|
||||||
|
|
||||||
responseCode = res.answer_code;
|
responseCode = res.answer_code;
|
||||||
|
TRI_ASSERT(res.answer != nullptr);
|
||||||
auto parsedResult = res.answer->toVelocyPack(&VPackOptions::Defaults);
|
auto parsedResult = res.answer->toVelocyPack(&VPackOptions::Defaults);
|
||||||
resultBody.swap(parsedResult);
|
resultBody.swap(parsedResult);
|
||||||
return TRI_ERROR_NO_ERROR;
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
@ -701,6 +702,7 @@ int createDocumentOnCoordinator(
|
||||||
}
|
}
|
||||||
resultMap.emplace(res.shardID, tmpBuilder);
|
resultMap.emplace(res.shardID, tmpBuilder);
|
||||||
} else {
|
} else {
|
||||||
|
TRI_ASSERT(res.answer != nullptr);
|
||||||
resultMap.emplace(res.shardID,
|
resultMap.emplace(res.shardID,
|
||||||
res.answer->toVelocyPack(&VPackOptions::Defaults));
|
res.answer->toVelocyPack(&VPackOptions::Defaults));
|
||||||
auto resultHeaders = res.answer->headers();
|
auto resultHeaders = res.answer->headers();
|
||||||
|
@ -1243,7 +1245,7 @@ int getFilteredDocumentsOnCoordinator(
|
||||||
size_t resCount = TRI_LengthArrayJson(documents);
|
size_t resCount = TRI_LengthArrayJson(documents);
|
||||||
for (size_t k = 0; k < resCount; ++k) {
|
for (size_t k = 0; k < resCount; ++k) {
|
||||||
try {
|
try {
|
||||||
TRI_json_t* element = TRI_LookupArrayJson(documents, k);
|
TRI_json_t const* element = TRI_LookupArrayJson(documents, k);
|
||||||
std::string id = arangodb::basics::JsonHelper::checkAndGetStringValue(
|
std::string id = arangodb::basics::JsonHelper::checkAndGetStringValue(
|
||||||
element, TRI_VOC_ATTRIBUTE_ID);
|
element, TRI_VOC_ATTRIBUTE_ID);
|
||||||
auto tmpBuilder = basics::JsonHelper::toVelocyPack(element);
|
auto tmpBuilder = basics::JsonHelper::toVelocyPack(element);
|
||||||
|
|
|
@ -562,6 +562,8 @@ class KeySpace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRI_ASSERT(dest != nullptr);
|
||||||
|
|
||||||
if (!TRI_IsArrayJson(dest->json)) {
|
if (!TRI_IsArrayJson(dest->json)) {
|
||||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_INTERNAL);
|
TRI_V8_THROW_EXCEPTION(TRI_ERROR_INTERNAL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2620,6 +2620,7 @@ static void MapGetVocBase(v8::Local<v8::String> const name,
|
||||||
|
|
||||||
if (collection != nullptr && collection->_cid == 0) {
|
if (collection != nullptr && collection->_cid == 0) {
|
||||||
delete collection;
|
delete collection;
|
||||||
|
collection = nullptr;
|
||||||
TRI_V8_RETURN(v8::Handle<v8::Value>());
|
TRI_V8_RETURN(v8::Handle<v8::Value>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue