1
0
Fork 0

fix various small annoyances (#9078)

This commit is contained in:
Jan 2019-05-23 17:37:34 +02:00 committed by GitHub
parent e721dd805d
commit e440a1c7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 16 deletions

View File

@ -250,7 +250,7 @@ bool AgencyWriteTransaction::validate(AgencyCommResult const& result) const {
}
std::string AgencyWriteTransaction::randomClientId() {
std::string uuid = to_string(boost::uuids::random_generator()()), id;
std::string uuid = to_string(boost::uuids::random_generator()());
auto ss = ServerState::instance();
if (ss != nullptr && !ss->getId().empty()) {

View File

@ -963,7 +963,6 @@ trans_ret_t Agent::transact(query_t const& queries) {
// own conclusions. The map of ongoing trxs is only to cover the time
// from when we receive the request until we have appended the trxs
// ourselves.
ret = std::make_shared<arangodb::velocypack::Builder>();
failed = 0;
ret->openArray();
// Only leader else redirect

View File

@ -21,6 +21,8 @@
////////////////////////////////////////////////////////////////////////////////
#include "ClusterCollectionCreationInfo.h"
#include "Basics/StaticStrings.h"
#include "Basics/VelocyPackHelper.h"
#include <velocypack/Builder.h>
#include <velocypack/Collection.h>

View File

@ -21,13 +21,11 @@
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION_INFO_H
#define ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION__INFO_H 1
#define ARANGOD_CLUSTER_CLUSTER_COLLECTION_CREATION_INFO_H 1
#include "Basics/Common.h"
#include "Basics/StaticStrings.h"
#include "Basics/VelocyPackHelper.h"
#include <velocypack/Builder.h>
#include <velocypack/Slice.h>
namespace arangodb {
@ -45,14 +43,14 @@ struct ClusterCollectionCreationInfo {
std::string name;
State state;
public:
public:
velocypack::Slice const isBuildingSlice() const;
private:
velocypack::Builder _isBuildingJson;
private:
bool needsBuildingFlag() const;
private:
velocypack::Builder _isBuildingJson;
};
} // namespace arangodb

View File

@ -54,7 +54,7 @@ class DatabaseManagerThread final : public Thread {
private:
// how long will the thread pause between iterations
static constexpr unsigned long waitTime() { return 500 * 1000; }
static constexpr unsigned long waitTime() { return 500U * 1000U; }
};
class DatabaseFeature : public application_features::ApplicationFeature {

View File

@ -3400,7 +3400,7 @@ Result Methods::replicateOperations(LogicalCollection const& collection,
count++;
}
if (count <= 0) {
if (count == 0) {
return Result{};
}

View File

@ -263,7 +263,6 @@ Result Collections::create(TRI_vocbase_t* vocbase,
TRI_ASSERT(infoSlice.isArray());
TRI_ASSERT(infoSlice.length() >= 1);
TRI_ASSERT(infoSlice.length() == infos.size());
collections.reserve(infoSlice.length() >= 1);
try {
if (ServerState::instance()->isCoordinator()) {
collections =
@ -275,6 +274,7 @@ Result Collections::create(TRI_vocbase_t* vocbase,
return Result(TRI_ERROR_INTERNAL, "createCollectionsOnCoordinator");
}
} else {
collections.reserve(infoSlice.length());
for (auto slice : VPackArrayIterator(infoSlice)) {
// Single server does not yet have a multi collection implementation
auto col = vocbase->createCollection(slice);

View File

@ -2291,7 +2291,7 @@ static void JS_CopyFile(v8::FunctionCallbackInfo<v8::Value> const& args) {
if (destinationIsDirectory) {
char const* file = strrchr(source.c_str(), TRI_DIR_SEPARATOR_CHAR);
if (file == nullptr) {
if (destination[destination.length()] == TRI_DIR_SEPARATOR_CHAR) {
if (!destination.empty() && destination.back() != TRI_DIR_SEPARATOR_CHAR) {
destination += TRI_DIR_SEPARATOR_CHAR;
}
destination += source;