Przeglądaj źródła

HdfFile: replace implicit bool conversion
(clang-tidy readability-implicit-bool-conversion)

https://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html

Fabian Peter Hammerle 6 lat temu
rodzic
commit
ab23ee590c
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      lib/HdfFile.cpp

+ 2 - 2
lib/HdfFile.cpp

@@ -71,11 +71,11 @@ int32 hdf4cpp::HdfFile::getDatasetId(const std::string &name) const {
 }
 int32 hdf4cpp::HdfFile::getGroupId(const std::string &name) const {
     int32 ref = Vfind(vId, name.c_str());
-    return (!ref) ? (FAIL) : (Vattach(vId, ref, "r"));
+    return (ref == 0) ? (FAIL) : (Vattach(vId, ref, "r"));
 }
 int32 hdf4cpp::HdfFile::getDataId(const std::string &name) const {
     int32 ref = VSfind(vId, name.c_str());
-    return (!ref) ? (FAIL) : (VSattach(vId, ref, "r"));
+    return (ref == 0) ? (FAIL) : (VSattach(vId, ref, "r"));
 }
 hdf4cpp::HdfItem hdf4cpp::HdfFile::get(const std::string &name) const {
     int32 id = getDatasetId(name);