X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=folly%2Ftest%2FFBVectorBenchmark.cpp;h=eaa0bc90357f66f382e1d2b22f0d76173f672db3;hb=cd1bdc912603c0358ba733d379a74ae90ab3a437;hp=6548c3f40f0c4f18594bd09fb02e706fe5105237;hpb=275ca94d04e44f28cfa411668eb1c1dd8db90b80;p=folly.git diff --git a/folly/test/FBVectorBenchmark.cpp b/folly/test/FBVectorBenchmark.cpp index 6548c3f4..eaa0bc90 100644 --- a/folly/test/FBVectorBenchmark.cpp +++ b/folly/test/FBVectorBenchmark.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015 Facebook, Inc. + * Copyright 2012-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,27 +17,26 @@ // // Author: andrei.alexandrescu@fb.com -#include -#include -#include -#include -#include - -#include - -#include #include #include + #include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace std; using namespace folly; auto static const seed = randomNumberSeed(); typedef boost::mt19937 RandomT; static RandomT rng(seed); -static const size_t maxString = 100; -static const bool avoidAliasing = true; template Integral2 random(Integral1 low, Integral2 up) { @@ -55,7 +54,7 @@ void randomString(String* toFill, unsigned int maxSize = 1000) { } template -void Num2String(String& str, Integral n) { +void Num2String(String& str, Integral /* n */) { str.resize(10, '\0'); sprintf(&str[0], "%ul", 10); str.resize(strlen(str.c_str())); @@ -70,13 +69,13 @@ std::list RandomList(unsigned int maxSize) { return lst; } -template T randomObject(); +template T randomObject(); -template<> int randomObject() { +template <> int randomObject() { return random(0, 1024); } -template<> folly::fbstring randomObject() { +template <> folly::fbstring randomObject() { folly::fbstring result; randomString(&result); return result;