From 324ed58c33381d687a4346edfa79f538d397a5f3 Mon Sep 17 00:00:00 2001 From: gangatp Date: Tue, 30 Jan 2024 19:50:33 +0530 Subject: [PATCH] refactoring --- Source/Common/NMR_StringUtils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Common/NMR_StringUtils.cpp b/Source/Common/NMR_StringUtils.cpp index ed1b5c0b6..7c663e492 100644 --- a/Source/Common/NMR_StringUtils.cpp +++ b/Source/Common/NMR_StringUtils.cpp @@ -161,11 +161,13 @@ namespace NMR { { throw CNMRException(NMR_ERROR_EMPTYSTRINGTODOUBLECONVERSION); } - else if (answer.ptr && answer.ptr[0] == ',') // Invalidate comma as decimal separator + else if (answer.ptr) // Invalidate comma as decimal separator { - throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION); + if (answer.ptr[0] == ',') + { + throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION); + } } - if ((dResult == HUGE_VAL) || (dResult == -HUGE_VAL)) throw CNMRException(NMR_ERROR_STRINGTODOUBLECONVERSIONOUTOFRANGE);