avoid repeated checks with same result on fast lookup path
commit7270f6f485f7b1308992bda059b3f874705c38db
authorLuboš Luňák <l.lunak@collabora.com>
Wed, 24 Nov 2021 11:33:06 +0000 (24 12:33 +0100)
committerLuboš Luňák <l.lunak@collabora.com>
Thu, 25 Nov 2021 13:27:08 +0000 (25 14:27 +0100)
treed6e06ee8822bd1294fe241e7e5fb3c58368653a6
parent9a96b1b5158428e4b1925816932d6d0060e6c3d6
avoid repeated checks with same result on fast lookup path

Change the compareByString() function to a template with a bool
parameter that will disable all the checks, allowing the compiler
to effectively generate just a small inline function. And then
compute the bool value once and call the fast version if true.
With comment #2 in tdf#136838 this actually saves 40% of time.

Change-Id: I5a5190f19a1df163b28e527090ec880e6de5bbda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125768
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
sc/source/core/data/table3.cxx