msctf: add internal function for handling TfClientIds

James Mckenzie jjmckenzie51 at earthlink.net
Mon Feb 23 08:33:37 CST 2009


Alexandre Julliard <julliard at winehq.org> wrote on Feb 23:
>
>Aric Stewart <aric at codeweavers.com> writes:
>
>> +    /* If i understand this correctly at most a process should generate
>> +     * only a handful of these...  But in case I am wrong */
>> +    if (id_last == 65535)
>> +    {
>> +        ERR("TfClientIds generated exceeds USHORT limit\n");
>> +        return 0x0;
>> +    }
>> +    id_last++;
>> +    id->id = MAKELONG(id_last, magic);
>> +    id->data = data;
>> +    list_add_head(&clientids,&id->entry);
>
>Using an array index would be cleaner than having to search through the
>list everytime you use an id.
>
Also, aren't linked lists inefficient as well.  Searching through them can be very intense, unless they are small (< 5 elements).  Anything larger than this and an array would be more efficient.

James McKenzie




More information about the wine-devel mailing list