Index: src/ResolvExpr/SpecCost.cc
===================================================================
--- src/ResolvExpr/SpecCost.cc	(revision 0bd3faf870391e5ed803287ec0b3c696cfde22b2)
+++ src/ResolvExpr/SpecCost.cc	(revision 5625427ee364fc12d70abe159b4e4d038eacf66a)
@@ -16,5 +16,4 @@
 #include <cassert>
 #include <limits>
-#include <list>
 #include <type_traits>
 
@@ -25,4 +24,13 @@
 
 namespace {
+
+const ast::Type * expr_result( const ast::ptr< ast::Expr > & expr ) {
+	return expr->result.get();
+}
+
+const ast::Type * type_deref( const ast::ptr< ast::Type > & type ) {
+	return type.get();
+}
+
 	/// The specialization counter inner class.
 	class SpecCounter : public ast::WithShortCircuiting, public ast::WithVisitorRef<SpecCounter> {
@@ -38,12 +46,4 @@
 			typename std::add_pointer<ast::Type const *(typename T::value_type const &)>::type;
 
-		#warning Should use a standard maybe_accept
-		void maybe_accept( ast::Type const * type ) {
-			if ( type ) {
-				auto node = type->accept( *visitor );
-				assert( node == nullptr || node == type );
-			}
-		}
-
 		// Update the minimum to the new lowest non-none value.
 		template<typename T>
@@ -51,5 +51,10 @@
 			for ( const auto & node : list ) {
 				count = -1;
-				maybe_accept( mapper( node ) );
+
+				if ( ast::Type const * type = mapper( node ) ) {
+					ast::Type const * newType = type->accept( *visitor );
+					assert( newType == nullptr || newType == type );
+				}
+
 				if ( count != -1 && count < minimum ) minimum = count;
 			}
@@ -62,15 +67,4 @@
 			updateMinimumPresent( minCount, list, mapper );
 			return toNoneOrInc( minCount );
-		}
-
-		// The three mappers:
-		static const ast::Type * decl_type( const ast::ptr< ast::DeclWithType > & decl ) {
-			return decl->get_type();
-		}
-		static const ast::Type * expr_result( const ast::ptr< ast::Expr > & expr ) {
-			return expr->result;
-		}
-		static const ast::Type * type_deref( const ast::ptr< ast::Type > & type ) {
-			return type.get();
 		}
 
@@ -122,8 +116,5 @@
 
 int specCost( const ast::Type * type ) {
-	if ( nullptr == type ) {
-		return 0;
-	}
-	return ast::Pass<SpecCounter>::read( type );
+	return ( nullptr == type ) ? 0 : ast::Pass<SpecCounter>::read( type );
 }
 
