From: Hannes Roth Date: Mon, 3 Mar 2014 17:18:59 +0000 (-0800) Subject: (Folly) Fix error when compiling with clang X-Git-Tag: v0.22.0~665 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=122b967d5eddfe95db32a313d44306846fbe4c8c;p=folly.git (Folly) Fix error when compiling with clang Summary: folly/Benchmark.cpp:427:9: error: logical not is only applied to the left hand side of this comparison if (!strcmp(get<1>(benchmarks[i]), "-") == 0) { Since the `!` binds to `strcmp`, removing both the `!` and the `== 0` should be equivalent. Reviewers of diff that introduced this line: D490324 Test Plan: I compiled `tao/client` with/without this diff. Reviewed By: delong.j@fb.com FB internal diff: D1196452 Blame Revision: rFBCODE6f5eea5fcd23044a5c579b040bf45d17006b4adf --- diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp index 127b6196..5de2c0d4 100644 --- a/folly/Benchmark.cpp +++ b/folly/Benchmark.cpp @@ -424,7 +424,7 @@ void runBenchmarks() { get<2>(benchmarks.front()), 0); FOR_EACH_RANGE (i, 1, benchmarks.size()) { double elapsed = 0.0; - if (!strcmp(get<1>(benchmarks[i]), "-") == 0) { // skip separators + if (strcmp(get<1>(benchmarks[i]), "-")) { // skip separators if (bmRegex && !boost::regex_search(get<1>(benchmarks[i]), *bmRegex)) { continue; }