[wp-hackers] [PATCH] Improve performance of convert_smilies by *10

Johan Eenfeldt johan.eenfeldt at gmail.com
Mon Jan 5 22:52:38 GMT 2009


On Mon, Jan 5, 2009 at 10:43 PM, Peter Westwood
<peter.westwood at ftwr.co.uk> wrote:
>
> On 5 Jan 2009, at 21:36, Johan Eenfeldt wrote:
>
>> On Mon, Jan 5, 2009 at 10:21 PM, Matt <speedboxer at gmail.com> wrote:
>>>>
>>>> Ok, so I rewrote it using preg_replace_callback(), as suggested by
>>>> sewpafly as well as the ticket. Patch attached.
>>>
>>> Attachments sent to this list are taken out before being sent to
>>> subscribers. Please upload your patch to the appropriate Trac ticket
>>> (or make a new ticket).
>>
>> Oh, ok. :)
>>
>> Found a relevant ticket and added patch:
>> http://trac.wordpress.org/ticket/6464
>>
>> / Johan, can you tell I'm new here?
>>
>
> Thank You!
>
> It would be good to see some sort of test harness for this too.
>
> We do have the beginnings of some unit tests for WordPress available [1]
>
> It would be good if you (or someone else) could write some tests for this to
> make sure we still have the same functionality before and after :-)
>
> Cheers
>
> westi
>
> [1] http://codex.wordpress.org/Automated_Testing

Ok, will look at writing one.

Good thing too as I found I mishandled :???: vs :? smilies (must sort
in reverse key order as regexp | is first match not greedy).

Thank you,
/ Johan


More information about the wp-hackers mailing list