Closed Bug 403960 Opened 18 years ago Closed 4 years ago

Use strchr, not strstr, for single-character seaches

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: swsnyder, Unassigned)

Details

(Keywords: perf)

Attachments

(1 file)

There are several uses of the strstr() function to determine if/where a given string contains a specific character. This search is more efficiently done using strchr(). At minimum, strchr has only a single pointer to validate, instead of the 2 pointers passed to strstr(). Beyond that it is just faster to find a single character in a string than it is to find an array of characters (substring). This patches touches mostly, but not exclusively, mailnews.
Status: NEW → ASSIGNED
Assignee: general → swsnyder
Status: ASSIGNED → NEW
Product: Mozilla Application Suite → Core
Superceded by application-specific bugs: 509730 and 509721.
QA Contact: general → general

The bug assignee didn't login in Bugzilla in the last 7 months.
:overholt, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: swsnyder → nobody
Flags: needinfo?(overholt)

Looks like this got fixed elsewhere. If not, somebody can file new bugs if they care.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(overholt)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: