From 46bd289493e4eae3cc438e41cb700cd48ddedf55 Mon Sep 17 00:00:00 2001 From: gregomni Date: Tue, 19 Jan 2016 22:24:49 -0800 Subject: [PATCH] [Sema] Misc code cleanup (removed unnecessary switch) Was just reading through the code here and noticed that the result of matchTypes() here is always the returned result from this function, so might as well save code and confusion and return it directly. --- lib/Sema/CSSimplify.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index 9985b7c902f..c2c17318e15 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -932,23 +932,10 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2, return SolutionKind::Error; // Result type can be covariant (or equal). - switch (matchTypes(func1->getResult(), func2->getResult(), subKind, + return matchTypes(func1->getResult(), func2->getResult(), subKind, subFlags, locator.withPathElement( - ConstraintLocator::FunctionResult))) { - case SolutionKind::Error: - return SolutionKind::Error; - - case SolutionKind::Solved: - result = SolutionKind::Solved; - break; - - case SolutionKind::Unsolved: - result = SolutionKind::Unsolved; - break; - } - - return result; + ConstraintLocator::FunctionResult)); } ConstraintSystem::SolutionKind