| 65 | // to a NULL value. |
| 66 | template <class Collection> |
| 67 | typename Collection::value_type::second_type FindPtrOrNull( |
| 68 | const Collection& collection, |
| 69 | const typename Collection::value_type::first_type& key) { |
| 70 | typename Collection::const_iterator it = collection.find(key); |
| 71 | if (it == collection.end()) { |
| 72 | return typename Collection::value_type::second_type(); |
| 73 | } |
| 74 | return it->second; |
| 75 | } |
| 76 | |
| 77 | // Returns a const reference to the value associated with the given key if it |
| 78 | // exists, otherwise returns a const reference to the provided default value. |
no test coverage detected