Closed Bug 155918 Opened 22 years ago Closed 21 years ago

inefficent use of search and match in linkToolbarHandler.js

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: drbrain-bugzilla)

References

Details

(Keywords: perf, polish)

Attachments

(1 file, 1 obsolete file)

search and match shouldn't be used when you can use test.
you don't need to lower case before testing, use /i instead.
you don't need separate tests, use | instead.
you don't need to test for ^|\W or \W|$, use \b instead.
Attached patch Proposed patch (obsolete) — Splinter Review
Bah, the fix to bug 102897 crept in. Too many patches :-(

-- 
"There are just too many notes." - Amadeus
Keywords: patch, perf, polish, review
Blocks: 103053
Changing platform and OS to All.
OS: Windows 95 → All
Hardware: PC → All
Attachment #90320 - Attachment is obsolete: true
Attachment #126055 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #126055 - Flags: superreview?(jst)
Comment on attachment 126055 [details] [diff] [review]
fixed and updated patch

Apparently i++ is bad in JS, change that to ++i for r=
Attachment #126055 - Flags: review?(neil.parkwaycc.co.uk) → review+
New information: i++ is not bad in JS, it's a habit I picked up from glazman :-)
Comment on attachment 126055 [details] [diff] [review]
fixed and updated patch

sr=jst
Attachment #126055 - Flags: superreview?(jst) → superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: