Changeset 4129 for trunk/tools/common/kList.cpp
- Timestamp:
- Aug 31, 2000, 5:00:13 AM (25 years ago)
- 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:46bird Exp $ */1 /* $Id: kList.cpp,v 1.3 2000-08-31 03:00:13 bird Exp $ */ 2 2 /* 3 3 * Simple list and sorted list template class. … … 90 90 } 91 91 92 assert(p != NULL); 93 92 94 pEntry->setNext(p); 93 95 if (pPrev != NULL) … … 126 128 kEntry *kSortedList<kEntry>::getFirst(void) const 127 129 { 130 128 131 return pFirst; 129 132 } … … 226 229 } 227 230 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 */ 236 template <class kEntry> 237 void 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 228 260 229 261 /**
Note:
See TracChangeset
for help on using the changeset viewer.