Closed
Bug 81758
Opened 24 years ago
Closed 23 years ago
Excessive use of strlen [form sub]
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
VERIFIED
FIXED
mozilla0.9.9
People
(Reporter: drepper, Assigned: john)
References
Details
(Keywords: perf)
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
The file
layout/html/forms/src/nsFormFrame.cpp
contains a lot of calls to the function PL_strlen() which are unnecessary.
If these calls would be to strlen() instead expressions like
strlen("FOO")
would be optimized by the compiler to the constant 3. But since PL_strlen
is used this cannot happen.
I'll attach a patch which replaces these uses of PL_strlen() with uses
of sizeof. sizeof is already used in some places in this file so the
concept is not new.
There is one more little patch included: one sprintf() call included in
the parameter list a string constant. Instead of doing this simply use
the string concatenation feature of the compiler which is in the same
sprintf() call already done with the macro CRLF.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Updated•24 years ago
|
Comment 2•24 years ago
|
||
This is all eric's code and he is doing some modifications to submits -
reassigning
Assignee: rods → pollmann
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0
Comment 3•23 years ago
|
||
Looks good to me. I say drop it in if the patch hasn't bit-rotted.
Updated•23 years ago
|
Summary: Excessive use of strlen → Excessive use of strlen [form sub]
Comment 6•23 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Comment 7•23 years ago
|
||
don't move bugs that are in the 1.0 dependency tree. sorry.
Target Milestone: mozilla1.0.1 → mozilla1.0
Comment 8•23 years ago
|
||
Reassigning to John. Moved to Moz1.1
Assignee: alexsavulov → jkeiser
Target Milestone: mozilla1.0 → mozilla1.1
Assignee | ||
Comment 9•23 years ago
|
||
This *will* be fixed in bug 120682. Lengths are calculated after everything is
concatenated together rather than in a big ol' separate loop. I just did a
search on "strlen" in the code and found nothing, in fact.
Depends on: 120682
Target Milestone: mozilla1.1 → mozilla0.9.9
Assignee | ||
Comment 11•23 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 12•23 years ago
|
||
verifying according to comment #9
("I just did a search on "strlen" in the code and found nothing, in fact.")
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•