From 85c2ed8dc790689ce69ff0a08ff5a4de98df54b7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 10 Apr 2022 20:17:54 +0200 Subject: loplugin:stringview add check for getToken().toInt32 where we can convert that to o3tl::toInt32(o3tl::getToken( and avoid the heap allocation of a temporary string Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810 Tested-by: Jenkins Reviewed-by: Noel Grandin --- opencl/source/openclconfig.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opencl/source/openclconfig.cxx') diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx index 525ef84ced6f..0c3597620d8e 100644 --- a/opencl/source/openclconfig.cxx +++ b/opencl/source/openclconfig.cxx @@ -19,6 +19,7 @@ #include #include #include +#include OpenCLConfig::OpenCLConfig() : mbUseOpenCL(true) @@ -80,7 +81,7 @@ OUString getToken(const OUString& string, sal_Int32& index) result.append(token.subView(i, p - i)); if (p < token.getLength() - 2) { - result.append(sal_Unicode(token.copy(p+1, 2).toInt32(16))); + result.append(sal_Unicode(o3tl::toInt32(token.subView(p+1, 2), 16))); i = p + 3; } else -- cgit