fix some compiler warnings

This commit is contained in:
Markus Pilman 2020-12-09 10:19:32 -07:00
parent d837e923ad
commit 2c4e38329e
4 changed files with 8 additions and 8 deletions

View File

@ -57,7 +57,7 @@ const Value keyServersValue( Standalone<RangeResultRef> result, const std::vecto
std::vector<Tag> destTag;
bool foundOldLocality = false;
for (const KeyValueRef kv : result) {
for (const KeyValueRef& kv : result) {
UID uid = decodeServerTagKey(kv.key);
if (std::find(src.begin(), src.end(), uid) != src.end()) {
srcTag.push_back( decodeServerTagValue(kv.value) );
@ -109,7 +109,7 @@ void decodeKeyServersValue( Standalone<RangeResultRef> result, const ValueRef& v
src.clear();
dest.clear();
for (const KeyValueRef kv : result) {
for (const KeyValueRef& kv : result) {
Tag tag = decodeServerTagValue(kv.value);
if (std::find(srcTag.begin(), srcTag.end(), tag) != srcTag.end()) {
src.push_back( decodeServerTagKey(kv.key) );
@ -122,7 +122,7 @@ void decodeKeyServersValue( Standalone<RangeResultRef> result, const ValueRef& v
std::sort(dest.begin(), dest.end());
if(missingIsError && (src.size() != srcTag.size() || dest.size() != destTag.size())) {
TraceEvent(SevError, "AttemptedToDecodeMissingTag");
for (const KeyValueRef kv : result) {
for (const KeyValueRef& kv : result) {
Tag tag = decodeServerTagValue(kv.value);
UID serverID = decodeServerTagKey(kv.key);
TraceEvent("TagUIDMap").detail("Tag", tag.toString()).detail("UID", serverID.toString());

View File

@ -121,7 +121,7 @@ std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> BackupProgr
}
}
for (const Tag tag : tags) { // tags without progress data
for (const Tag& tag : tags) { // tags without progress data
tagVersions.insert({ tag, adjustedBeginVersion });
TraceEvent("BackupVersionRange", dbgid)
.detail("OldEpoch", epoch)

View File

@ -508,7 +508,7 @@ ACTOR Future<Void> setBackupKeys(BackupData* self, std::map<UID, Version> savedL
state std::vector<Future<Optional<Version>>> prevVersions;
state std::vector<BackupConfig> versionConfigs;
state std::vector<Future<Optional<bool>>> allWorkersReady;
for (const auto [uid, version] : savedLogVersions) {
for (const auto& [uid, version] : savedLogVersions) {
versionConfigs.emplace_back(uid);
prevVersions.push_back(versionConfigs.back().latestBackupWorkerSavedVersion().get(tr));
allWorkersReady.push_back(versionConfigs.back().allWorkerStarted().get(tr));
@ -573,7 +573,7 @@ ACTOR Future<Void> monitorBackupProgress(BackupData* self) {
if (self->recruitedEpoch == self->oldestBackupEpoch) {
// update update progress so far if previous epochs are done
Version v = std::numeric_limits<Version>::max();
for (const auto [tag, version] : tagVersions) {
for (const auto& [tag, version] : tagVersions) {
v = std::min(v, version);
}
savedLogVersions.emplace(uid, v);
@ -783,7 +783,7 @@ ACTOR Future<Void> saveMutationsToFile(BackupData* self, Version popVersion, int
.detail("TagId", self->tag.id)
.detail("File", file->getFileName());
}
for (const UID uid : activeUids) {
for (const UID& uid : activeUids) {
self->backups[uid].lastSavedVersion = popVersion + 1;
}

View File

@ -1778,7 +1778,7 @@ ACTOR Future<Void> commitProxyServerCore(CommitProxyInterface proxy, MasterInter
state KeyRange txnKeys = allKeys;
Standalone<RangeResultRef> UIDtoTagMap = commitData.txnStateStore->readRange( serverTagKeys ).get();
state std::map<Tag, UID> tag_uid;
for (const KeyValueRef kv : UIDtoTagMap) {
for (const KeyValueRef& kv : UIDtoTagMap) {
tag_uid[decodeServerTagValue(kv.value)] = decodeServerTagKey(kv.key);
}
loop {