-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gmessages: Avoid strings duplication if there's nothing to format
g_print(), g_printerr() and all the g_log() functions used to always duplicating a string when printing even if there's nothing to format. This can be avoided in many cases though, so if a string has no formatting directive, we can just write it as it is without duplicating and free'ing it. From my tests the potential `strchr` overhead is minimal.
- Loading branch information
Showing
1 changed file
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters