summaryrefslogtreecommitdiffstats
path: root/src/vim9type.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2024-04-23 20:14:46 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-23 20:14:46 +0200
commita16f251333e324c94ca8e3e92d1fcf3193dfa382 (patch)
treed09dde5c33b8e1612588e8c97f9143f9a8fd5309 /src/vim9type.c
parentea999037a41292b3d3e00700a87a82fe5d2c12b2 (diff)
patch 9.1.0367: compile_def_function is too longv9.1.0367
Problem: compile_def_function is too long Solution: Move out the code to compile the body of a function (Yegappan Lakshmanan) closes: #14622 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/vim9type.c')
-rw-r--r--src/vim9type.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/vim9type.c b/src/vim9type.c
index 228df6e2fa..775291e743 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -1894,14 +1894,12 @@ type_name_list_or_dict(char *name, type_T *type, char **tofree)
size_t len = STRLEN(name) + STRLEN(member_name) + 3;
*tofree = alloc(len);
- if (*tofree != NULL)
- {
- vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
- vim_free(member_free);
- return *tofree;
- }
+ if (*tofree == NULL)
+ return name;
- return name;
+ vim_snprintf(*tofree, len, "%s<%s>", name, member_name);
+ vim_free(member_free);
+ return *tofree;
}
/*
@@ -1924,17 +1922,15 @@ type_name_class_or_obj(char *name, type_T *type, char **tofree)
size_t len = STRLEN(name) + STRLEN(class_name) + 3;
*tofree = alloc(len);
- if (*tofree != NULL)
- {
- vim_snprintf(*tofree, len, "%s<%s>", name, class_name);
- return *tofree;
- }
+ if (*tofree == NULL)
+ return name;
- return name;
+ vim_snprintf(*tofree, len, "%s<%s>", name, class_name);
+ return *tofree;
}
/*
- * Return the type name of a functio.
+ * Return the type name of a function.
* The result may be in allocated memory, in which case "tofree" is set.
*/
static char *