removed unnecessary restoration code in string_to_fpdec()

This commit is contained in:
hyung-hwan 2019-01-08 08:57:37 +00:00
parent de44f7e57c
commit 0011937699

View File

@ -259,13 +259,15 @@ static hcl_oop_t string_to_fpdec (hcl_t* hcl, hcl_oocs_t* str, const hcl_ioloc_t
} }
HCL_ASSERT (hcl, scale > 0); HCL_ASSERT (hcl, scale > 0);
/*if (scale > 0)*/ HCL_MEMMOVE (&str->ptr[pos], &str->ptr[pos + 1], scale * HCL_SIZEOF(str->ptr[0])); /*if (scale > 0)*/ HCL_MEMMOVE (&str->ptr[pos], &str->ptr[pos + 1], scale * HCL_SIZEOF(str->ptr[0])); /* remove the decimal point */
break; break;
} }
} }
/* if no decimal point is included or no digit after the point , you must not call this function */
HCL_ASSERT (hcl, scale > 0);
v = hcl_strtoint(hcl, str->ptr, str->len - 1, 10); v = hcl_strtoint(hcl, str->ptr, str->len - 1, 10);
/*if (scale > 0)*/ HCL_MEMMOVE (&str->ptr[pos + 1], &str->ptr[pos], scale * HCL_SIZEOF(str->ptr[0]));
if (!v) return HCL_NULL; if (!v) return HCL_NULL;
return hcl_makefpdec(hcl, v, scale); return hcl_makefpdec(hcl, v, scale);