Ignore:
Timestamp:
Aug 31, 2000, 5:00:13 AM (25 years ago)
Author:
bird
Message:

Fixes and enhancements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kList.cpp

    r3237 r4129  
    1 /* $Id: kList.cpp,v 1.2 2000-03-25 23:17:46 bird Exp $ */
     1/* $Id: kList.cpp,v 1.3 2000-08-31 03:00:13 bird Exp $ */
    22/*
    33 * Simple list and sorted list template class.
     
    9090        }
    9191
     92        assert(p != NULL);
     93
    9294        pEntry->setNext(p);
    9395        if (pPrev != NULL)
     
    126128kEntry *kSortedList<kEntry>::getFirst(void) const
    127129{
     130
    128131    return pFirst;
    129132}
     
    226229}
    227230
     231#if 0
     232/**
     233 * Inserts an entry into the list in an ascending sorted fashion.
     234 * @param   pEntry  Pointer to entry to insert.
     235 */
     236template <class kEntry>
     237void kList<kEntry>::insertSorted(kEntry *pEntry)
     238{
     239    if (pEntry == NULL)
     240        return;
     241    if (pFirst == NULL)
     242    {
     243        pEntry->setNext(NULL);
     244        pLast = pFirst = pEntry;
     245    }
     246    else
     247    {   /* linear search */
     248        kEntry *pCur = pFirst;
     249
     250        pCur->
     251
     252        pEntry->setNext(NULL);
     253        pLast->setNext(pEntry);
     254        pLast = pEntry;
     255    }
     256    cEntries++;
     257}
     258#endif
     259
    228260
    229261/**
Note: See TracChangeset for help on using the changeset viewer.