Show
Ignore:
Timestamp:
04/28/06 11:39:49 (4 years ago)
Author:
ahu
Message:

replace ugly cache insertion/deleting code by nice alternative from Joaquin Lopez Munoz

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/syncres.hh

    r780 r785  
    412412 
    413413extern RecursorStats g_stats; 
     414 
     415 
     416template<typename Index> 
     417std::pair<typename Index::iterator,bool> 
     418replacing_insert(Index& i,const typename Index::value_type& x) 
     419{ 
     420  std::pair<typename Index::iterator,bool> res=i.insert(x); 
     421  if(!res.second)res.second=i.replace(res.first,x); 
     422  return res; 
     423} 
     424 
    414425#endif