(Folly) Fix error when compiling with clang
authorHannes Roth <hannesr@fb.com>
Mon, 3 Mar 2014 17:18:59 +0000 (09:18 -0800)
committerDave Watson <davejwatson@fb.com>
Mon, 10 Mar 2014 20:50:04 +0000 (13:50 -0700)
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

index 127b6196e95f20c53031e97f7464f9ac61dda5a4..5de2c0d494fe425b33b9f1bd87eba797e1da78e0 100644 (file)
@@ -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;
       }