# HG changeset patch # User Richard Laager # Date 1181193920 0 # Node ID c529c95e7733adcebd114e0b3d77482b06140e9f # Parent beeef78409b21cffd0aa67d8006b309dcb3a9955 Size the formatting string first, to avoid unnecessary resizing. diff -r beeef78409b2 -r c529c95e7733 libpurple/plugins/log_reader.c --- a/libpurple/plugins/log_reader.c Thu Jun 07 05:23:31 2007 +0000 +++ b/libpurple/plugins/log_reader.c Thu Jun 07 05:25:20 2007 +0000 @@ -1460,7 +1460,7 @@ read = escaped; /* Apply formatting... */ - formatted = g_string_new(""); + formatted = g_string_sized_new(strlen(read)); c = read; line = read; while (c)