kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [3/4] kudu git commit: Fix all 'misc-string-compare' warnings from clang-tidy
Date Fri, 09 Jun 2017 20:28:50 GMT
Fix all 'misc-string-compare' warnings from clang-tidy

See https://clang.llvm.org/extra/clang-tidy/checks/misc-string-compare.html
for details

(auto-generated using clang-tidy --fix with only this check enabled)

Change-Id: I18e609172eda7793f79ed9bb8ddafdf3b85d5fb0
Reviewed-on: http://gerrit.cloudera.org:8080/7131
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/3e249697
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3e249697
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3e249697

Branch: refs/heads/master
Commit: 3e249697a506918319e89b1b1aecdb7cb5a634f5
Parents: 1632d16
Author: Todd Lipcon <todd@cloudera.com>
Authored: Thu Jun 8 19:06:46 2017 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Fri Jun 9 20:28:06 2017 +0000

----------------------------------------------------------------------
 src/kudu/common/partition.cc                   | 4 ++--
 src/kudu/util/compression/compression_codec.cc | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/3e249697/src/kudu/common/partition.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partition.cc b/src/kudu/common/partition.cc
index c600b2a..bbb6343 100644
--- a/src/kudu/common/partition.cc
+++ b/src/kudu/common/partition.cc
@@ -68,8 +68,8 @@ Slice Partition::range_key(const string& partition_key) const {
 
 bool Partition::Equals(const Partition& other) const {
   if (this == &other) return true;
-  if (partition_key_start().compare(other.partition_key_start()) != 0) return false;
-  if (partition_key_end().compare(other.partition_key_end()) != 0) return false;
+  if (partition_key_start() != other.partition_key_start()) return false;
+  if (partition_key_end() != other.partition_key_end()) return false;
   if (hash_buckets_ != other.hash_buckets_) return false;
   return true;
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/3e249697/src/kudu/util/compression/compression_codec.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/compression/compression_codec.cc b/src/kudu/util/compression/compression_codec.cc
index ee774cd..4995023 100644
--- a/src/kudu/util/compression/compression_codec.cc
+++ b/src/kudu/util/compression/compression_codec.cc
@@ -266,13 +266,13 @@ CompressionType GetCompressionCodecType(const std::string& name)
{
   string uname;
   ToUpperCase(name, &uname);
 
-  if (uname.compare("SNAPPY") == 0)
+  if (uname == "SNAPPY")
     return SNAPPY;
-  if (uname.compare("LZ4") == 0)
+  if (uname == "LZ4")
     return LZ4;
-  if (uname.compare("ZLIB") == 0)
+  if (uname == "ZLIB")
     return ZLIB;
-  if (uname.compare("NONE") == 0)
+  if (uname == "NONE")
     return NO_COMPRESSION;
 
   LOG(WARNING) << "Unable to recognize the compression codec '" << name


Mime
View raw message