Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
/*
* This GtkIMHtml has the maximum number of smileys allowed, so don't
* add any more. We do this for performance reasons, because smileys
* are apparently pretty inefficient. Hopefully we can remove this
* restriction when we're using a better HTML widget.
*/
unescaped = purple_unescape_html(smiley);
numsmileys_thismsg = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_thismsg"));
if (numsmileys_thismsg >= 30) {
gtk_text_buffer_insert(imhtml->text_buffer, iter, unescaped, -1);
g_free(unescaped);
return;
}
numsmileys_total = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(imhtml), "gtkimhtml_numsmileys_total"));
if (numsmileys_total >= 300) {
gtk_text_buffer_insert(imhtml->text_buffer, iter, unescaped, -1);
g_free(unescaped);
return;
}
Вот такой прикол от Pidgin. Больше 30 смайлов в сообщении и 300 в диалоге - низя. Захардкодили, ибо стыдно, что тормозит. А оно действительно тормозит.
Комментарии (9) RSS