From 6ab2e8d558790059b18eb62bdfd44167b9117b2e Mon Sep 17 00:00:00 2001 From: contriteobserver Date: Sun, 28 Feb 2021 15:13:01 -0800 Subject: [PATCH] simplified the getRealAttribute implementation --- include/assimp/XmlParser.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/assimp/XmlParser.h b/include/assimp/XmlParser.h index 4d212232a..2f123c54a 100644 --- a/include/assimp/XmlParser.h +++ b/include/assimp/XmlParser.h @@ -178,25 +178,18 @@ public: return true; } -#ifdef ASSIMP_DOUBLE_PRECISION static inline bool getRealAttribute( XmlNode &xmlNode, const char *name, ai_real &val ) { pugi::xml_attribute attr = xmlNode.attribute(name); if (attr.empty()) { return false; } +#ifdef ASSIMP_DOUBLE_PRECISION val = attr.as_double(); - return true; - } #else - static inline bool getRealAttribute(XmlNode &xmlNode, const char *name, ai_real &val ) { - pugi::xml_attribute attr = xmlNode.attribute(name); - if (attr.empty()) { - return false; - } val = attr.as_float(); +#endif return true; } -#endif static inline bool getFloatAttribute(XmlNode &xmlNode, const char *name, float &val ) { pugi::xml_attribute attr = xmlNode.attribute(name);