Bug 28448 - convert FormatBlock candidate tag list from if chain to hash lookup
Summary: convert FormatBlock candidate tag list from if chain to hash lookup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-18 23:33 PDT by Maciej Stachowiak
Modified: 2009-08-19 01:11 PDT (History)
0 users

See Also:


Attachments
patch v1 (3.05 KB, patch)
2009-08-18 23:34 PDT, Maciej Stachowiak
no flags Details | Formatted Diff | Diff
patch v2 (3.10 KB, patch)
2009-08-19 00:00 PDT, Maciej Stachowiak
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2009-08-18 23:33:44 PDT
the validBlockTag() function does a long nested chain of if comparisons to C strings, which is lame. A hash lookup would be better.
Comment 1 Maciej Stachowiak 2009-08-18 23:34:51 PDT
Created attachment 35103 [details]
patch v1
Comment 2 Darin Adler 2009-08-18 23:36:00 PDT
Comment on attachment 35103 [details]
patch v1

What about empty string and null string? Does the contains function do the right thing for those?
Comment 3 Dave Hyatt 2009-08-18 23:36:51 PDT
Comment on attachment 35103 [details]
patch v1

r=me
Comment 4 Maciej Stachowiak 2009-08-19 00:00:36 PDT
Created attachment 35104 [details]
patch v2

Last version had a bug, as pointed out by Darin.
Comment 5 Oliver Hunt 2009-08-19 01:01:39 PDT
Comment on attachment 35104 [details]
patch v2

r=me
Comment 6 Maciej Stachowiak 2009-08-19 01:11:21 PDT
Committed r47499: <http://trac.webkit.org/changeset/47499>