THRIFT-4776:Modernize c++11 code by clang-tidy (#1732)
* use override
* use make_shared
* use emplace
* use range for
* fix error on MSVC
* replace boost functions with std functions
* fix static analyzer warnings
* check api return value
* initialize member
* check the return value of SSL_peek > 0
* add override
diff --git a/lib/cpp/test/TFileTransportTest.cpp b/lib/cpp/test/TFileTransportTest.cpp
index ad32185..21c1f3b 100644
--- a/lib/cpp/test/TFileTransportTest.cpp
+++ b/lib/cpp/test/TFileTransportTest.cpp
@@ -279,12 +279,12 @@
BOOST_WARN_GE(calls->size(), static_cast<FsyncLog::CallList::size_type>(1));
const struct timeval* prev_time = nullptr;
- for (auto it = calls->begin(); it != calls->end(); ++it) {
+ for (const auto & call : *calls) {
if (prev_time) {
- int delta = time_diff(prev_time, &it->time);
+ int delta = time_diff(prev_time, &call.time);
BOOST_WARN( delta < max_allowed_delta );
}
- prev_time = &it->time;
+ prev_time = &call.time;
}
}