1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-24 03:46:39 +02:00

scripts: reformat some code to make it more readable

This commit is contained in:
Sébastien Helleu
2015-02-21 09:16:25 +01:00
parent 8f11de6863
commit c1a5a76d08
6 changed files with 45 additions and 46 deletions
+8 -5
View File
@@ -251,11 +251,8 @@ weechat_python_dict_to_hashtable (PyObject *dict, int size,
Py_ssize_t pos;
char *str_key, *str_value;
hashtable = weechat_hashtable_new (size,
type_keys,
type_values,
NULL,
NULL);
hashtable = weechat_hashtable_new (size, type_keys, type_values,
NULL, NULL);
if (!hashtable)
return NULL;
@@ -270,19 +267,25 @@ weechat_python_dict_to_hashtable (PyObject *dict, int size,
str_key = strdup (PyBytes_AsString (key));
}
else
{
str_key = weechat_python_unicode_to_string (key);
}
if (PyBytes_Check (value))
{
if (PyBytes_AsString (value))
str_value = strdup (PyBytes_AsString (value));
}
else
{
str_value = weechat_python_unicode_to_string (value);
}
if (str_key)
{
if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0)
{
weechat_hashtable_set (hashtable, str_key, str_value);
}
else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)
{
weechat_hashtable_set (hashtable, str_key,