From f34c8c466a0e514edac2e8683127b4176ad5d321 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 18 Jun 2018 07:58:28 +0200 Subject: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. --- src/timedata.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/timedata.cpp') diff --git a/src/timedata.cpp b/src/timedata.cpp index 1599508306..291111feb2 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -94,7 +94,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) { // If nobody has a time different than ours but within 5 minutes of ours, give a warning bool fMatch = false; - for (int64_t nOffset : vSorted) + for (const int64_t nOffset : vSorted) if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; @@ -109,7 +109,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) } if (LogAcceptCategory(BCLog::NET)) { - for (int64_t n : vSorted) { + for (const int64_t n : vSorted) { LogPrint(BCLog::NET, "%+d ", n); /* Continued */ } LogPrint(BCLog::NET, "| "); /* Continued */ -- cgit v1.2.3