common: Make frequently called util methods more efficient
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Sep 2017 23:04:25 +0000 (01:04 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 3 Sep 2017 23:20:52 +0000 (01:20 +0200)
commitb06a827aea68b050bf23c37e0162189a94595ee9
treebb0354a966a0a663faf7f22c2fc371077ff14b39
parent1ff488d99e1c655926105a41c76fe158dd41f236
common: Make frequently called util methods more efficient

Remove unnecessary temporary allocations and string copies in the
various methods in util.*, and avoid calling API functions that do
more than we need them to do in favor of an efficient implementation.

Ensure that frequently used QRegExp instances are created statically
and reused between invocations, so they can make use of JIT and other
optimizations.

As some of the affected methods are called *very* frequently, this
provides significant savings in terms of allocations, and
significantly reduces memory fragmentation as well.

Modernize some of the related code. Clean up includes, too.
src/common/quassel.cpp
src/common/util.cpp
src/common/util.h
src/qtui/qtuistyle.cpp
src/uisupport/actioncollection.cpp