patch 9.0.1098: code uses too much indent

Problem:    Code uses too much indent.
Solution:   Use an early return. (Yegappan Lakshmanan, closes #11747)
diff --git a/src/cmdhist.c b/src/cmdhist.c
index ea95547..d398ca7 100644
--- a/src/cmdhist.c
+++ b/src/cmdhist.c
@@ -460,44 +460,46 @@
     int		last;
     int		found = FALSE;
 
-    regmatch.regprog = NULL;
+    if (hislen == 0 || histype < 0 || histype >= HIST_COUNT || *str == NUL
+		|| hisidx[histype] < 0)
+	return FALSE;
+
+    idx = hisidx[histype];
+    regmatch.regprog = vim_regcomp(str, RE_MAGIC + RE_STRING);
+    if (regmatch.regprog == NULL)
+	return FALSE;
+
     regmatch.rm_ic = FALSE;	// always match case
-    if (hislen != 0
-	    && histype >= 0
-	    && histype < HIST_COUNT
-	    && *str != NUL
-	    && (idx = hisidx[histype]) >= 0
-	    && (regmatch.regprog = vim_regcomp(str, RE_MAGIC + RE_STRING))
-								      != NULL)
+
+    i = last = idx;
+    do
     {
-	i = last = idx;
-	do
+	hisptr = &history[histype][i];
+	if (hisptr->hisstr == NULL)
+	    break;
+	if (vim_regexec(&regmatch, hisptr->hisstr, (colnr_T)0))
 	{
-	    hisptr = &history[histype][i];
-	    if (hisptr->hisstr == NULL)
-		break;
-	    if (vim_regexec(&regmatch, hisptr->hisstr, (colnr_T)0))
+	    found = TRUE;
+	    vim_free(hisptr->hisstr);
+	    clear_hist_entry(hisptr);
+	}
+	else
+	{
+	    if (i != last)
 	    {
-		found = TRUE;
-		vim_free(hisptr->hisstr);
+		history[histype][last] = *hisptr;
 		clear_hist_entry(hisptr);
 	    }
-	    else
-	    {
-		if (i != last)
-		{
-		    history[histype][last] = *hisptr;
-		    clear_hist_entry(hisptr);
-		}
-		if (--last < 0)
-		    last += hislen;
-	    }
-	    if (--i < 0)
-		i += hislen;
-	} while (i != idx);
-	if (history[histype][idx].hisstr == NULL)
-	    hisidx[histype] = -1;
-    }
+	    if (--last < 0)
+		last += hislen;
+	}
+	if (--i < 0)
+	    i += hislen;
+    } while (i != idx);
+
+    if (history[histype][idx].hisstr == NULL)
+	hisidx[histype] = -1;
+
     vim_regfree(regmatch.regprog);
     return found;
 }