Opened 20 years ago
Closed 20 years ago
#755 closed defect (fixed)
are psArrayRemove() semantics appropriate?
| Reported by: | jhoblitt | Owned by: | jhoblitt |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | IPP SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | rhl@… |
Description
The current prototype for this function is:
bool psArrayRemove (psArray *array, const psPtr data)
But for reasons of reliablity and efficeny I think it should be:
bool psArrayRemove (psArray *array, long n)
I'm not sure if the current behavior is really useful enough to be kept.
Change History (4)
comment:1 by , 20 years ago
| Cc: | added |
|---|
comment:2 by , 20 years ago
| Owner: | changed from to |
|---|
i don't see any reason not to make this change. it is used within pxTools as
well, but I'm guessing you know that.
comment:3 by , 20 years ago
I haven't used it anywhere because the API is so nasty. I'll go ahead and fix it.
comment:4 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
I've added a psArrayRemoveByPos() as there are actually a couple of cases where
psArrayRemove()'s current semtanitcs make sense. I think you could argue that
psArrayRemoveByPos() should be named psArrayRemove() and the current
psArrayRemove() named psArrayRemoveByPtr() as better huffman encoding but that's
really starting to split hairs.

Is there any reason why I can't make this change? I can only see 3 places
inside of psLib where it's used and one one of these instances is a great
example of how unworkable the current API is.
if(!psArrayRemove(levelArray,levelArray->data[*level]))