[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.
This commit is contained in:
gregomni
2016-01-19 22:24:49 -08:00
parent 6964301977
commit 46bd289493

View File

@@ -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