Commit 5bae0794 authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Store array type precision in string form.

Slight performance improvement for large file writes.
parent e5f83ed7
......@@ -109,6 +109,9 @@ XdmfArrayType::XdmfArrayType(const std::string & name,
mName(name),
mPrecision(precision)
{
std::stringstream precisionString;
precisionString << precision;
mPrecisionString = precisionString.str();
}
XdmfArrayType::~XdmfArrayType()
......@@ -193,7 +196,5 @@ void
XdmfArrayType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties.insert(std::make_pair("DataType", mName));
std::stringstream precision;
precision << mPrecision;
collectedProperties.insert(std::make_pair("Precision", precision.str()));
collectedProperties.insert(std::make_pair("Precision", mPrecisionString));
}
......@@ -111,8 +111,9 @@ private:
static shared_ptr<const XdmfArrayType>
New(const std::map<std::string, std::string> & itemProperties);
std::string mName;
unsigned int mPrecision;
const std::string mName;
const unsigned int mPrecision;
std::string mPrecisionString;
};
#endif /* XDMFARRAYTYPE_HPP_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment