File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,8 @@ class CFastList
307
307
template <class T , class U >
308
308
bool ListContains (const CFastList<T*>& itemList, const U& item)
309
309
{
310
+ if (itemList.empty ())
311
+ return false ;
310
312
return itemList.contains (item);
311
313
}
312
314
Original file line number Diff line number Diff line change @@ -344,13 +344,14 @@ namespace SharedUtil
344
344
template <class TL , class T >
345
345
bool ListContains (const TL& itemList, const T& item)
346
346
{
347
+ if (itemList.empty ())
348
+ return false ;
347
349
typename TL ::const_iterator it = itemList.begin ();
348
350
for (; it != itemList.end (); ++it)
349
351
if (item == *it)
350
352
return true ;
351
353
return false ;
352
354
}
353
-
354
355
// Add item if it does not aleady exist in itemList
355
356
template <class TL , class T >
356
357
void ListAddUnique (TL& itemList, const T& item)
You can’t perform that action at this time.
0 commit comments