Igor Mironchik <igor.mironc...@gmail.com> 于2025年5月23日周五 00:21写道: > > Hi. > > I'd like to ask you, guys, maybe I'm a dumb a little, and you know how > to optimize a following function. > > inline long long int > skipIf(long long int startPos, const QString &line, > const std::function<bool(const QChar &)> &pred, > long long int endPos = -1)
Since you have a very simple inner loop, changing `pred` from `std::function` (essentially a function pointer) to a template parameter might help a bit with inlining if `pred` is simple.