From: Mario Date: Tue, 24 Dec 2019 16:50:13 +0000 (+1000) Subject: Use strcat instead of sprintf in ReplicateVars, improves client-side performance... X-Git-Tag: xonotic-v0.8.5~1188 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=ee3c3cf64912023c288aceee4188169147df0d8d Use strcat instead of sprintf in ReplicateVars, improves client-side performance a bit (heavily called function) --- diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index ee39b1881a..d855500659 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -865,7 +865,7 @@ void ReplicateVars(bool would_destroy) { if (!would_destroy) FOREACH(Notifications, it.nent_type == MSG_CHOICE, { - string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it)); + string cvarname = strcat("notification_", Get_Notif_CvarName(it)); // NOTE: REPLICATE_SIMPLE can return; REPLICATE_SIMPLE(it.cvar_value, cvarname); });