py: Removing dangling "else" to improve code format consistency.

This commit is contained in:
Damien George
2020-02-20 00:17:13 +11:00
parent 4b23e98fb0
commit a1b18b3ba7
8 changed files with 39 additions and 32 deletions

View File

@@ -297,19 +297,19 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte *p
if (mp_obj_is_type(val_in, &mp_type_int)) {
mp_obj_int_to_bytes_impl(val_in, struct_type == '>', size, p);
return;
} else
}
#endif
{
val = mp_obj_get_int(val_in);
// zero/sign extend if needed
if (BYTES_PER_WORD < 8 && size > sizeof(val)) {
int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00;
memset(p, c, size);
if (struct_type == '>') {
p += size - sizeof(val);
}
val = mp_obj_get_int(val_in);
// zero/sign extend if needed
if (BYTES_PER_WORD < 8 && size > sizeof(val)) {
int c = (is_signed(val_type) && (mp_int_t)val < 0) ? 0xff : 0x00;
memset(p, c, size);
if (struct_type == '>') {
p += size - sizeof(val);
}
}
break;
}
mp_binary_set_int(MIN((size_t)size, sizeof(val)), struct_type == '>', p, val);