James Bursa wrote:
> Hope I'm not too late to give my ideas on this.
>
Not at all, the review seems to have been progressing slowly :-)
> I think that lookup tables would be clearer than the hashing here and easier
> to maintain in future (e.g. adding new types), unless profiling has shown
> this
> to be a bottleneck. For example
>
> struct favicon_type_entry {
> char type[40];
> int score;
> };
> static const struct favicon_type_entry favicon_type_table[] = {
> {"apple-touch-icon", 5},
> {"application/icon", 5},
> ...
> };
>
> and then bsearch can be used to find an entry. We use this method in several
> places in NetSurf, for example see element_table in box_construct.c
>
very sensible; I've hopefully implemented it in r8717-8718
>>> Index: render/favicon.h
>>> +typedef enum {
>>> + HHICON = 0x7c98572e,
>>> + /* icon */
>>>
>
> This seems a duplicate of the #defines in the .c.
>
I noticed that in passing :-)
Maybe it was the thunderbolts; be that as it may I have moved the
typedef enum to the .c now
thanks for the constructive comments :-)
> James
>
>
Best regards
Mark
http://www.halloit.com
Key ID 046B65CF