Changeset 339
- Timestamp:
- 09/23/14 02:04:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/handle.hh
r333 r339 103 103 { 104 104 std::swap( m_entries[ h1.index() ].index, m_entries[ h2.index() ].index ); 105 } 106 107 bool is_valid( handle h ) const 108 { 109 typedef handle_operator<HANDLE> hop; 110 if ( h.is_nil() ) return false; 111 if ( h.index() >= m_entries.size() ) return false; 112 const index_entry& entry = m_entries[ h.index() ]; 113 return entry.index >= 0 && entry.counter == hop::get_counter(h); 105 114 } 106 115 … … 183 192 void remove( handle h ) 184 193 { 194 if ( h.is_nil() || h.index() >= m_indexes.size() || m_indexes[h.index()] == -1 ) 195 return; 185 196 handle swap_handle = m_handles.back(); 186 197 sint32 dead_eindex = m_indexes[ h.index() ]; … … 259 270 m_handles.push_back( m_indexes.create_handle( sint32( m_data.size() - 1 ) ) ); 260 271 return m_handles.back(); 272 } 273 274 bool is_valid( handle h ) 275 { 276 return m_indexes.is_valid(h); 261 277 } 262 278
Note: See TracChangeset
for help on using the changeset viewer.