ns-allinone-2.35/rap/raplist.cc
void *List::SortedRemove(float *keyPtr)
{
  ListElement *element = first;
  void *thing;
  
  if (IsEmpty()) 
    return NULL;
  
  thing = first->item;
  if (first == last) 
    {				// List had one item, now has none 
      first = NULL;
      last = NULL;
    } 
  else 
    first = element->next;

  if (keyPtr != NULL)
    *keyPtr = element->key;
  delete element;
  
  size--;
  return thing;
}
//----------------------------------------------------------------------
// List::SortedRemove
//      Remove the first "item" from the front of a sorted List.
// 
// Returns:
//	Pointer to removed item, NULL if nothing on the List.
//	Sets *keyPtr to the priority value of the removed item
//	(this is needed by interrupt.cc, for instance).
//
//	"keyPtr" is a pointer to the location in which to store the 
//		priority of the removed item.
//----------------------------------------------------------------------
:SortedRemove
Remove the first "item" from the front of a sorted List.

Pointer to removed item, NULL if nothing on the List.
Sets *keyPtr to the priority value of the removed item
(this is needed by interrupt.cc, for instance).

"keyPtr" is a pointer to the location in which to store the
priority of the removed item.
: SortedRemove Remove the first " item " from the front of a sorted List . Pointer to removed item NULL if nothing on the List . Sets * keyPtr to the priority value of the removed item ( this is needed by interrupt . cc for instance ) . " keyPtr " is a pointer to the location in which to store the priority of the removed item .
void *List::SortedRemove(float *keyPtr)
{
  ListElement *element = first;
  void *thing;
  if (IsEmpty()) 
    return NULL;
  thing = first->item;
  if (first == last) 
    {				
      first = NULL;
      last = NULL;
    } 
  else 
    first = element->next;
  if (keyPtr != NULL)
    *keyPtr = element->key;
  delete element;
  size--;
  return thing;
}
void * List :: SortedRemove ( float * keyPtr ) { ListElement * element = first ; void * thing ; if ( IsEmpty ( ) ) return NULL ; thing = first -> item ; if ( first == last ) { first = NULL ; last = NULL ; } else first = element -> next ; if ( keyPtr != NULL ) * keyPtr = element -> key ; delete element ; size -- ; return thing ; }
List::SortedRemove
Remove the first "item" from the front of a sorted List.
List :: SortedRemove Remove the first " item " from the front of a sorted List .
// List had one item, now has none 