1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

core: return directly output of string_dyn_free without temporary variable

This commit is contained in:
Sébastien Helleu
2022-12-19 07:04:33 +01:00
parent 40339b288a
commit 42113ebc0f
4 changed files with 8 additions and 22 deletions
+2 -5
View File
@@ -1947,7 +1947,7 @@ string_translate_chars (const char *string,
{
int length, length2, translated;
const char *ptr_string, *ptr_chars1, *ptr_chars2;
char **result, *ptr_result;
char **result;
if (!string)
return NULL;
@@ -1984,10 +1984,7 @@ string_translate_chars (const char *string,
ptr_string = utf8_next_char (ptr_string);
}
ptr_result = *result;
string_dyn_free (result, 0);
return ptr_result;
return string_dyn_free (result, 0);
}
/*
+2 -6
View File
@@ -426,7 +426,7 @@ gui_bar_window_expand_spacers (const char *string, int length_on_screen,
int bar_window_width, int num_spacers)
{
int *spacers, index_spacer, i;
char **result, *result2, *next_char;
char **result, *next_char;
if (!string || !string[0])
return NULL;
@@ -517,11 +517,7 @@ gui_bar_window_expand_spacers (const char *string, int length_on_screen,
free (spacers);
result2 = *result;
string_dyn_free (result, 0);
return result2;
return string_dyn_free (result, 0);
}
/*
+2 -6
View File
@@ -1741,7 +1741,7 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data,
struct t_gui_nick_group *ptr_group;
struct t_gui_nick *ptr_nick;
struct t_config_option *ptr_option;
char **nicklist, *str_nicklist;
char **nicklist;
int i;
/* make C compiler happy */
@@ -1874,11 +1874,7 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data,
gui_nicklist_get_next_item (buffer, &ptr_group, &ptr_nick);
}
str_nicklist = *nicklist;
string_dyn_free (nicklist, 0);
return str_nicklist;
return string_dyn_free (nicklist, 0);
}
/*
+2 -5
View File
@@ -702,7 +702,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
{
enum t_gui_bar_filling filling;
const char *ptr_content;
char **content, *content2, str_reinit_color[32];
char **content, str_reinit_color[32];
char str_reinit_color_space[32], str_reinit_color_space_start_line[32];
char str_start_item[32];
char *item_value, *item_value2, ****split_items, **linear_items;
@@ -987,10 +987,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
return NULL;
}
content2 = *content;
string_dyn_free (content, 0);
return content2;
return string_dyn_free (content, 0);
}
/*