NerixyzandGitHub e16c23f51b refactor: Allocate less in parseTwitchEmotes (#7187)
`parseTwitchEmotes` and `appendTwitchEmoteOccurrences` do some string
parsing. Notably they split the emote range strings
(`<emote-id>:<ranges...>/<emote-id>:...`) into owned `QString`s. They
don't have to do that.

This PR moves the parsing from using `QString`s to `QStringView`s and
using `tokenize` (lazy split) and `splitOnce`. Furthermore, the message
indices are now stack-allocated if possible and use 16 bits (enough for
Twitch messages).

Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-08-22 11:41:50 +00:00
2026-04-07 18:21:07 +00:00
2026-03-22 12:50:28 +01:00
2026-01-02 14:56:29 +00:00
2017-10-13 21:57:43 +02:00

chatterinoLogo Chatterino 2 GitHub Actions Build (Windows, Ubuntu, MacOS) Build FreeBSD Chocolatey Package Flatpak Package

Chatterino 2 is a chat client for Twitch.tv. The Chatterino 2 wiki can be found here. Contribution guidelines can be found here.

Download

Current releases are available at https://chatterino.com. Windows users can also install Chatterino from Chocolatey.

Nightly build

You can download the latest Chatterino 2 build over here

You might also need to install the VC++ Redistributables from Microsoft if you do not have it installed already.
If you still receive an error about MSVCR120.dll missing, then you should install the VC++ 2013 Restributable.

Building

To get source code with required submodules run:

git clone --recurse-submodules https://github.com/Chatterino/chatterino2.git

or

git clone https://github.com/Chatterino/chatterino2.git
cd chatterino2
git submodule update --init --recursive

Git blame

This project has big commits in the history which touch most files while only doing stylistic changes. To improve the output of git-blame, consider setting:

git config blame.ignoreRevsFile .git-blame-ignore-revs

This will ignore all revisions mentioned in the .git-blame-ignore-revs file. GitHub does this by default.

Code style

The code is formatted using clang-format. Our configuration is found in the .clang-format file in the repository root directory.

For more contribution guidelines, take a look at the wiki.

Doxygen

Doxygen is used to generate project information daily and is available here.

Languages
C++ 95%
CMake 2.5%
Python 1.2%
Lua 0.7%
Shell 0.3%
Other 0.2%