From: Yedidya Feldblum Date: Tue, 22 Sep 2015 21:03:09 +0000 (-0700) Subject: Fully clean up before each round of benchmarks in RangeFindBenchmark.cpp X-Git-Tag: deprecate-dynamic-initializer~383 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4bfa1a41db9d1e54ffb9a32aa9d39c8bd6e28b02;p=folly.git Fully clean up before each round of benchmarks in RangeFindBenchmark.cpp Summary: [Folly] Fully clean up before each round of benchmarks in `RangeFindBenchmark.cpp`. The `vstr` and `vstrp` globals need to be cleaned up before each round of benchmarks. Reviewed By: @​@​nbronson Differential Revision: D2467254 --- diff --git a/folly/test/RangeFindBenchmark.cpp b/folly/test/RangeFindBenchmark.cpp index 7d7a872d..2c920b72 100644 --- a/folly/test/RangeFindBenchmark.cpp +++ b/folly/test/RangeFindBenchmark.cpp @@ -43,8 +43,11 @@ std::vector vstrp; std::string file; void initStr(int len) { - cout << "string length " << len << ':' << endl; str.clear(); + vstr.clear(); + vstrp.clear(); + + cout << "string length " << len << ':' << endl; str.reserve(len + 1); str.append(len, 'a'); str.append(1, 'b');