diff src/os_qnx.c @ 31752:3365a601e73b v9.0.1208

patch 9.0.1208: code is indented more than necessary Commit: https://github.com/vim/vim/commit/a41e221935edab62672a15123af48f4f14ac1c7d Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Jan 16 18:19:05 2023 +0000 patch 9.0.1208: code is indented more than necessary Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11819)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Jan 2023 19:30:04 +0100
parents 44b855153d8e
children 97255d909654
line wrap: on
line diff
--- a/src/os_qnx.c
+++ b/src/os_qnx.c
@@ -67,38 +67,38 @@ clip_mch_request_selection(Clipboard_T *
     char_u	    *clip_text = NULL;
 
     cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
-    if (cbdata != NULL)
-    {
-	// Look for the vim specific clip first
-	clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
-	if (clip_header != NULL && clip_header->data != NULL)
-	{
-	    switch(*(char *) clip_header->data)
-	    {
-		default: // fallthrough to line type
-		case 'L': type = MLINE; break;
-		case 'C': type = MCHAR; break;
-		case 'B': type = MBLOCK; break;
-	    }
-	    is_type_set = TRUE;
-	}
+    if (cbdata == NULL)
+	return;
 
-	// Try for just normal text
-	clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
-	if (clip_header != NULL)
+    // Look for the vim specific clip first
+    clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
+    if (clip_header != NULL && clip_header->data != NULL)
+    {
+	switch(*(char *) clip_header->data)
 	{
-	    clip_text = clip_header->data;
-	    clip_length  = clip_header->length - 1;
+	    default: // fallthrough to line type
+	    case 'L': type = MLINE; break;
+	    case 'C': type = MCHAR; break;
+	    case 'B': type = MBLOCK; break;
+	}
+	is_type_set = TRUE;
+    }
 
-	    if (clip_text != NULL && is_type_set == FALSE)
-		type = MAUTO;
-	}
+    // Try for just normal text
+    clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
+    if (clip_header != NULL)
+    {
+	clip_text = clip_header->data;
+	clip_length  = clip_header->length - 1;
 
-	if ((clip_text != NULL) && (clip_length > 0))
-	    clip_yank_selection(type, clip_text, clip_length, cbd);
+	if (clip_text != NULL && is_type_set == FALSE)
+	    type = MAUTO;
+    }
 
-	PhClipboardPasteFinish(cbdata);
-    }
+    if ((clip_text != NULL) && (clip_length > 0))
+	clip_yank_selection(type, clip_text, clip_length, cbd);
+
+    PhClipboardPasteFinish(cbdata);
 }
 
 void