1
0
Fork 0

small fixes (#10380)

This commit is contained in:
Jan 2019-11-11 09:28:05 +01:00 committed by GitHub
parent 484e2971d6
commit 6c814223f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -305,7 +305,9 @@ void message::prepareForNetwork(VSTVersion vstVersion, MessageID messageId,
}
if (chunkDataLen > 0) {
assert(payload.size() > 0);
#ifdef FUERTE_DEBUG
assert(begin < end);
#endif
// Add chunk data buffer
result.emplace_back(begin, chunkDataLen);
begin += chunkDataLen;

View File

@ -28,6 +28,7 @@
#include "Basics/ConditionLocker.h"
#include "Basics/Exceptions.h"
#include "Basics/MutexLocker.h"
#include "Basics/NumberUtils.h"
#include "Basics/RecursiveLocker.h"
#include "Basics/StringUtils.h"
#include "Basics/VelocyPackHelper.h"
@ -964,6 +965,7 @@ void ClusterInfo::loadPlan() {
shards->reserve(shardIDs->size());
for (auto const& p : *shardIDs) {
TRI_ASSERT(p.first.size() >= 2);
shards->push_back(p.first);
newShardServers.try_emplace(p.first, p.second);
}
@ -973,8 +975,10 @@ void ClusterInfo::loadPlan() {
shards->begin(), // begin
shards->end(), // end
[](std::string const& a, std::string const& b) -> bool {
return std::strtol(a.c_str() + 1, nullptr, 10) <
std::strtol(b.c_str() + 1, nullptr, 10);
TRI_ASSERT(a.size() >= 2);
TRI_ASSERT(b.size() >= 2);
return NumberUtils::atoi_zero<uint64_t>(a.c_str() + 1, a.c_str() + a.size()) <
NumberUtils::atoi_zero<uint64_t>(b.c_str() + 1, b.c_str() + b.size());
} // comparator
);
newShards.try_emplace(collectionId, std::move(shards));