Skip to content

Commit 001f27f

Browse files
committed
Try replacing operator==() by isSame()
1 parent 2268c24 commit 001f27f

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/IO/ADIOS/ADIOS2PreloadAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ PreloadAdiosAttributes::getAttribute(std::string const &name) const
248248
}
249249
AttributeLocation const &location = it->second;
250250
Datatype determinedDatatype = determineDatatype<T>();
251-
if (location.dt != determinedDatatype)
251+
if (!isSame(location.dt, determinedDatatype))
252252
{
253253
std::stringstream errorMsg;
254254
errorMsg << "[ADIOS2] Wrong datatype for attribute: " << name

src/IO/JSON/JSONIOHandlerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ auto JSONIOHandlerImpl::verifyDataset(
23322332
}
23332333
Datatype dt = stringToDatatype(j["datatype"].get<std::string>());
23342334
VERIFY_ALWAYS(
2335-
dt == parameters.dtype,
2335+
isSame(dt, parameters.dtype),
23362336
"[JSON] Read/Write request does not fit the dataset's type");
23372337
}
23382338
catch (json::basic_json::type_error &)

src/RecordComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void RecordComponent::verifyChunk(
657657
if (empty())
658658
throw std::runtime_error(
659659
"Chunks cannot be written for an empty RecordComponent.");
660-
if (dtype != getDatatype())
660+
if (!isSame(dtype, getDatatype()))
661661
{
662662
std::ostringstream oss;
663663
oss << "Datatypes of chunk data (" << dtype

src/Series.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,12 +1950,11 @@ void Series::readOneIterationFileBased(std::string const &filePath)
19501950

19511951
readBase();
19521952

1953-
using DT = Datatype;
19541953
aRead.name = "iterationEncoding";
19551954
IOHandler()->enqueue(IOTask(this, aRead));
19561955
IOHandler()->flush(internal::defaultFlushParams);
19571956
IterationEncoding encoding_out;
1958-
if (*aRead.dtype == DT::STRING)
1957+
if (isSame(*aRead.dtype, Datatype::STRING))
19591958
{
19601959
std::string encoding = Attribute(Attribute::from_any, *aRead.m_resource)
19611960
.get<std::string>();
@@ -2010,7 +2009,7 @@ void Series::readOneIterationFileBased(std::string const &filePath)
20102009
aRead.name = "iterationFormat";
20112010
IOHandler()->enqueue(IOTask(this, aRead));
20122011
IOHandler()->flush(internal::defaultFlushParams);
2013-
if (*aRead.dtype == DT::STRING)
2012+
if (isSame(*aRead.dtype, Datatype::STRING))
20142013
{
20152014
setWritten(false, Attributable::EnqueueAsynchronously::No);
20162015
setIterationFormat(Attribute(Attribute::from_any, *aRead.m_resource)

0 commit comments

Comments
 (0)