diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-16 14:48:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-17 09:12:26 +0200 |
commit | b1df9c67349cf4cc5be4128d797aefb87f50e38f (patch) | |
tree | 171fbccaadecd8fac85e1e6212ce560162fabc7f /sal/rtl/strtmpl.hxx | |
parent | 3545caa5aac59022d5c00d4a0c2a74657cbcae8d (diff) |
[API CHANGE] reduce cost of numeric conversion
on a hot path, since we already know the length of these strings.
Which requires adding some new variants of our string conversion
functions
Change-Id: I1877f8f3c72934c07f14eec7e73bbe8d7b0f1808
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119065
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl/strtmpl.hxx')
-rw-r--r-- | sal/rtl/strtmpl.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx index 094a1cc1f2ab..493184f92efa 100644 --- a/sal/rtl/strtmpl.hxx +++ b/sal/rtl/strtmpl.hxx @@ -914,6 +914,16 @@ sal_Int32 toInt32 ( const IMPL_RTL_STRCODE* pStr, } template <typename IMPL_RTL_STRCODE> +sal_Int32 toInt32_WithLength ( const IMPL_RTL_STRCODE* pStr, + sal_Int16 nRadix, + sal_Int32 nStrLength) + +{ + assert(pStr); + return toInt_WithLength<sal_Int32, sal_uInt32>(pStr, nRadix, nStrLength); +} + +template <typename IMPL_RTL_STRCODE> sal_Int64 toInt64 ( const IMPL_RTL_STRCODE* pStr, sal_Int16 nRadix ) { |