summaryrefslogtreecommitdiffstats
path: root/src/clientserver.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-09 19:04:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 19:04:23 +0000
commit1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch)
treeb746eda548993b9e0987d7c9c0c543ddddc5758f /src/clientserver.c
parent765d82a657c5e42d5d7c88ae410e53f398c34c43 (diff)
patch 9.0.1166: code is indented more than necessaryv9.0.1166
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
Diffstat (limited to 'src/clientserver.c')
-rw-r--r--src/clientserver.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/clientserver.c b/src/clientserver.c
index 2a091a6e97..dfbb8a8b03 100644
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -157,22 +157,22 @@ serverConvert(
char_u *res = data;
*tofree = NULL;
- if (client_enc != NULL && p_enc != NULL)
- {
- vimconv_T vimconv;
+ if (client_enc == NULL || p_enc == NULL)
+ return res;
- vimconv.vc_type = CONV_NONE;
- if (convert_setup(&vimconv, client_enc, p_enc) != FAIL
- && vimconv.vc_type != CONV_NONE)
- {
- res = string_convert(&vimconv, data, NULL);
- if (res == NULL)
- res = data;
- else
- *tofree = res;
- }
- convert_setup(&vimconv, NULL, NULL);
+ vimconv_T vimconv;
+
+ vimconv.vc_type = CONV_NONE;
+ if (convert_setup(&vimconv, client_enc, p_enc) != FAIL
+ && vimconv.vc_type != CONV_NONE)
+ {
+ res = string_convert(&vimconv, data, NULL);
+ if (res == NULL)
+ res = data;
+ else
+ *tofree = res;
}
+ convert_setup(&vimconv, NULL, NULL);
return res;
}
#endif