Commit 96652b6f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Apply clang-format in places

Summary: [Folly] Apply `clang-format` in places.

Reviewed By: markisaa

Differential Revision: D19249033

fbshipit-source-id: 1a768eea013112ee5cd9d8b78114927fd6d6db04
parent 88065016
......@@ -292,7 +292,6 @@ TEST(F14Set, equalityRefinement) {
#include <string>
#include <unordered_set>
using namespace folly;
using namespace folly::f14;
using namespace folly::string_piece_literals;
......
......@@ -1911,8 +1911,7 @@ void AsyncSSLSocket::clientHelloParsingCallback(
uint8_t>::value,
"unexpected underlying type");
auto typ =
static_cast<ssl::NameType>(cursor.readBE<uint8_t>());
auto typ = static_cast<ssl::NameType>(cursor.readBE<uint8_t>());
auto nameLength = cursor.readBE<uint16_t>();
if (typ == NameType::HOST_NAME &&
......
......@@ -35,17 +35,17 @@
* @param expectedMS The timeout duration, in milliseconds
* @param tolerance The tolerance, in milliseconds.
*/
#define T_CHECK_TIMEOUT(start, end, expectedMS, ...) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), false, ##__VA_ARGS__)) { \
ADD_FAILURE() \
<< "Timeout violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \
.count(); \
#define T_CHECK_TIMEOUT(start, end, expectedMS, ...) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), false, ##__VA_ARGS__)) { \
ADD_FAILURE() << "Timeout violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \
.count(); \
}
/**
......@@ -54,15 +54,15 @@
* This is similar to T_CHECK_TIMEOUT, but does not fail if the event took less
* than the allowed time.
*/
#define T_CHECK_TIME_LT(start, end, expectedMS, ...) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), true, ##__VA_ARGS__)) { \
ADD_FAILURE() \
<< "Interval violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>(expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \
.count(); \
#define T_CHECK_TIME_LT(start, end, expectedMS, ...) \
if (!::folly::checkTimeout( \
(start), (end), (expectedMS), true, ##__VA_ARGS__)) { \
ADD_FAILURE() << "Interval violates constraints, expectedMs = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
expectedMS) \
.count() \
<< ", elapsed wall time ms = " \
<< std::chrono::duration_cast<std::chrono::milliseconds>( \
(end).getTime() - (start).getTime()) \
.count(); \
}
......@@ -26,7 +26,6 @@
#include <folly/Benchmark.h>
BENCHMARK(nextPowTwoClz, iters) {
for (unsigned long i = 0; i < iters; ++i) {
auto x = folly::nextPowTwo(i);
......
......@@ -21,7 +21,6 @@
#include <folly/Benchmark.h>
#include <folly/portability/GTest.h>
// clang-format off
[[noreturn]] void fail() {
FOLLY_SAFE_CHECK(0 + 0, "hello");
......
......@@ -24,8 +24,7 @@ ThreadCachedArena::ThreadCachedArena(size_t minBlockSize, size_t maxAlign)
: minBlockSize_(minBlockSize), maxAlign_(maxAlign) {}
SysArena* ThreadCachedArena::allocateThreadLocalArena() {
auto arena =
new SysArena(minBlockSize_, SysArena::kNoSizeLimit, maxAlign_);
auto arena = new SysArena(minBlockSize_, SysArena::kNoSizeLimit, maxAlign_);
auto disposer = [this](SysArena* t, TLPDestructionMode mode) {
std::unique_ptr<SysArena> tp(t); // ensure it gets deleted
if (mode == TLPDestructionMode::THIS_THREAD) {
......
......@@ -261,8 +261,7 @@ TDigest TDigest::merge(Range<const TDigest*> digests) {
// It is possible that the next block is incomplete (less than
// digestsPerBlock big). In that case, merge to end. Otherwise, merge to
// the end of that block.
auto last =
(i + (digestsPerBlock * 2) < starts.size())
auto last = (i + (digestsPerBlock * 2) < starts.size())
? *(starts.begin() + i + 2 * digestsPerBlock)
: centroids.end();
std::inplace_merge(first, middle, last);
......
......@@ -589,7 +589,6 @@ TEST(DistributedMutex, BasicTryLock) {
}
TEST(DistributedMutex, TestSingleElementContentionChain) {
// Acquire the mutex once, let another thread form a contention chain on the
// mutex, and then release it. Observe the other thread grab the lock
auto&& schedule = test::ManualSchedule{};
......@@ -620,7 +619,6 @@ TEST(DistributedMutex, TestSingleElementContentionChain) {
}
TEST(DistributedMutex, TestTwoElementContentionChain) {
// Acquire the mutex once, let another thread form a contention chain on the
// mutex, and then release it. Observe the other thread grab the lock
auto&& schedule = test::ManualSchedule{};
......@@ -667,7 +665,6 @@ TEST(DistributedMutex, TestTwoElementContentionChain) {
}
TEST(DistributedMutex, TestTwoContentionChains) {
auto&& schedule = test::ManualSchedule{};
auto&& mutex = test::TestDistributedMutex<test::ManualAtomic>{};
......
......@@ -28,7 +28,6 @@
#include <folly/portability/SysMman.h>
#include <folly/synchronization/test/Barrier.h>
using namespace folly::test;
namespace {
......
......@@ -809,12 +809,16 @@ struct LargePODConstructTo {
struct NonPODConstructTo {
explicit NonPODConstructTo(Source) {}
NonPODConstructTo(NonPODConstructTo const&) {}
NonPODConstructTo& operator=(NonPODConstructTo const&) { return *this; }
NonPODConstructTo& operator=(NonPODConstructTo const&) {
return *this;
}
};
struct ConvertTo {
explicit ConvertTo(Source) {}
ConvertTo& operator=(Source) { return *this; }
ConvertTo& operator=(Source) {
return *this;
}
};
static_assert(
......@@ -840,7 +844,8 @@ static_assert(constructibleNotConvertible<SmallPODConstructTo>(), "");
static_assert(constructibleNotConvertible<LargePODConstructTo>(), "");
static_assert(constructibleNotConvertible<NonPODConstructTo>(), "");
static_assert(expected_detail::IsConvertible<Source, ConvertTo>(),
static_assert(
expected_detail::IsConvertible<Source, ConvertTo>(),
"convertible");
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment