Index: src/Common/ScopedMap.h
===================================================================
--- src/Common/ScopedMap.h	(revision e9b50434ce6bdadbbeec1c812d5b5c1b1322637d)
+++ src/Common/ScopedMap.h	(revision 21a2a7d9c6395caabfb563f85756ba506c922512)
@@ -167,5 +167,11 @@
 	}
 
-	iterator erase( iterator pos );
+	/// Erases element with key in the innermost scope that has it.
+	size_type erase( const Key & key ) {
+		for ( auto it = scopes.rbegin() ; it != scopes.rend() ; ++it ) {
+			if ( size_type i = it->map.erase( key ) ; 0 != i ) return i;
+		}
+		return 0;
+	}
 
 	size_type count( const Key & key ) const {
@@ -345,13 +351,4 @@
 };
 
-template<typename Key, typename Value, typename Note>
-typename ScopedMap<Key, Value, Note>::iterator
-		ScopedMap<Key, Value, Note>::erase( iterator pos ) {
-	MapType & scope = (*pos.scopes)[ pos.level ].map;
-	const typename iterator::wrapped_iterator & new_it = scope.erase( pos.it );
-	iterator it( *pos.scopes, new_it, pos.level );
-	return it.next_valid();
-}
-
 // Local Variables: //
 // tab-width: 4 //
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision e9b50434ce6bdadbbeec1c812d5b5c1b1322637d)
+++ src/SymTab/Validate.cc	(revision 21a2a7d9c6395caabfb563f85756ba506c922512)
@@ -863,9 +863,5 @@
 
 	void ReplaceTypedef::premutate( TypeDecl * typeDecl ) {
-		TypedefMap::iterator i = typedefNames.find( typeDecl->name );
-		if ( i != typedefNames.end() ) {
-			typedefNames.erase( i ) ;
-		} // if
-
+		typedefNames.erase( typeDecl->name );
 		typedeclNames.insert( typeDecl->name, typeDecl );
 	}
Index: src/Validate/ReplaceTypedef.cpp
===================================================================
--- src/Validate/ReplaceTypedef.cpp	(revision e9b50434ce6bdadbbeec1c812d5b5c1b1322637d)
+++ src/Validate/ReplaceTypedef.cpp	(revision 21a2a7d9c6395caabfb563f85756ba506c922512)
@@ -186,8 +186,5 @@
 
 void ReplaceTypedefCore::previsit( ast::TypeDecl const * decl ) {
-	TypedefMap::iterator iter = typedefNames.find( decl->name );
-	if ( iter != typedefNames.end() ) {
-		typedefNames.erase( iter );
-	}
+	typedefNames.erase( decl->name );
 	typedeclNames.insert( decl->name, decl );
 }
