Closed
Bug 188865
Opened 22 years ago
Closed 15 years ago
Add a RFindCharInReadable function
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: Biesinger, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
7.62 KB,
patch
|
dbaron
:
review-
|
Details | Diff | Splinter Review |
Currently, there is RFindInReadable for searching strings in strings from right
to left, and FindCharInReadable for finding characters in strings from the left.
What's missing is RFindCharInReadable, to find the last occurence of a character
(like strrchr)
would come handy for bug 188586 comment 3
Updated•22 years ago
|
Summary: Add a RFindCharInReable function → Add a RFindCharInReadable function
Reporter | ||
Comment 2•21 years ago
|
||
taking
Assignee: scc → cbiesinger
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.6alpha
Reporter | ||
Comment 3•21 years ago
|
||
Reporter | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Updated•21 years ago
|
Attachment #133102 -
Flags: review?(jag)
It would be much more efficient to write this the way FindCharInReadable is
written. (FWIW, see also bug 82054.) You'd need to add rfind to nsCharTraits.
Reporter | ||
Updated•21 years ago
|
Attachment #133102 -
Flags: review?(jag)
Reporter | ||
Comment 5•21 years ago
|
||
Comment on attachment 133102 [details] [diff] [review]
patch
ok... I'll do that
Attachment #133102 -
Attachment is obsolete: true
Reporter | ||
Comment 6•21 years ago
|
||
Reporter | ||
Updated•21 years ago
|
Attachment #133148 -
Flags: review?(dbaron)
Reporter | ||
Comment 7•21 years ago
|
||
Comment on attachment 133148 [details] [diff] [review]
implement&use nsCharTraits<...>::rfind
nevermind. this hangs when given a multiple-fragment string
Attachment #133148 -
Attachment is obsolete: true
Attachment #133148 -
Flags: review?(dbaron) → review-
Reporter | ||
Comment 8•21 years ago
|
||
Reporter | ||
Comment 9•21 years ago
|
||
Comment on attachment 133156 [details] [diff] [review]
fix hang
I created two test programs to test the chartraits changes and then the
RFindCharInReadable functions. I can attach them if you want
Attachment #133156 -
Flags: review?(dbaron)
Comment 10•21 years ago
|
||
Do you get better code with the n-- loop control, where n is induced by s, or
would you get better code if you saved the initial s in t, added n-1, and looped
while s >= t?
/be
Comment on attachment 133156 [details] [diff] [review]
fix hang
I think it would be better to have RFindCharInReadable take the first iterator
as a const reference and the second iterator as a non-const reference, and
modify the second when the character is found. This allows for repeated
searches using the same iterators, and would also simplify the implementation.
(Others may disagree, though.)
Other than that, it looks fine, although I didn't look at the code in
nsReadableUtils.cpp too closely.
Attachment #133156 -
Flags: review?(dbaron) → review-
Reporter | ||
Comment 12•21 years ago
|
||
darin's string update probably bitrotted this a lot... don't think I'll update
this anytime soon, -> default owner
Assignee: cbiesinger → string
Status: ASSIGNED → NEW
Reporter | ||
Updated•21 years ago
|
Priority: P1 → --
Target Milestone: mozilla1.6alpha → ---
Updated•15 years ago
|
Assignee: string → nobody
QA Contact: scc → string
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
Assignee | ||
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•