From 122b967d5eddfe95db32a313d44306846fbe4c8c Mon Sep 17 00:00:00 2001 From: Hannes Roth Date: Mon, 3 Mar 2014 09:18:59 -0800 Subject: [PATCH] (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 --- folly/Benchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.34.1