Closed Bug 258098 Opened 21 years ago Closed 18 years ago

nsValueArray needs a SetSize()

Categories

(Core :: XPCOM, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: csthomas, Assigned: regis.caspar+bz)

References

Details

Attachments

(2 files, 1 obsolete file)

<CTho> do we need to implement a setsize for nsvaluearray? <NeilZZZ> it looks like it, the reverse code needs it and the thread sort code needs it <CTho> so setsize needs to either truncate or grow and fill with empty values? <NeilZZZ> right... not as easy as replace was
Whiteboard: waiting on 258058 so I don't bitrot my own patches
Product: Browser → Seamonkey
Whiteboard: waiting on 258058 so I don't bitrot my own patches → helpwanted, waiting on 258058 to not bitrot patches
Assignee: cst → general
Whiteboard: helpwanted, waiting on 258058 to not bitrot patches → helpwanted
Target Milestone: --- → Future
Attached a patch proposal. Is it normal that the [] operator fails (returns a pointer (?) here and not a nvValueArrayValue)? Is this patch the suitable place to add a test?
Assignee: general → nobody
Component: General → XPCOM
OS: Windows XP → All
Product: Mozilla Application Suite → Core
QA Contact: general → xpcom
Hardware: PC → All
Target Milestone: Future → ---
(In reply to comment #1) >Attached a patch proposal. Thanks for the patch, but I don't think this quite does what we were looking for; this bug was filed to make nsUInt32Array.cpp obsolete, and its SetSize changes the count (and clears new items) as well as the checking the capacity. >Is this patch the suitable place to add a test? Yes.
Thanks for your answer Neil, I will take a look at nsUInt32Array.cpp and will submit a new patch if no-one did it before.
Here is a new patch.
Attachment #273157 - Attachment is obsolete: true
Attached file test results
This is my test program output
OK, so the next step is to find someone to review your patch. dougt@meer.net benjamin@smedbergs.us and darin@meer.net are listed on the module owners document as current peers although benjamin looks to be the most active.
Assignee: nobody → regis.caspar+bz
Comment on attachment 274274 [details] [diff] [review] proposed patch + new test for nsValueArray Thanks for the directions Neil :)
Attachment #274274 - Flags: review?(benjamin)
What are the clients of nsValueArray, and why do we want to add this API to it? I would prefer that all new consumers use nsTArray<PRInt32> or something like that.
guess this'd be for bug 250811, which predates nsTArray
Comment on attachment 274274 [details] [diff] [review] proposed patch + new test for nsValueArray I would prefer not to extend this class any more, but switch clients to nsTArray (unless there is a compelling reason I haven't heard yet).
Attachment #274274 - Flags: review?(benjamin) → review-
OK (I don't know the background history of that bug..) -> Removing the "helpwanted" for now.
Whiteboard: helpwanted
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: