IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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 jhoblitt, 20 years ago

Cc: rhl@… added

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]))

comment:2 by eugene, 20 years ago

Owner: changed from eugene to jhoblitt

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 jhoblitt, 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 jhoblitt, 20 years ago

Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.