Cleanup: redundant checks
This commit is contained in:
@@ -6476,10 +6476,8 @@ static void cursor_buffer_show(const GWL_Seat *seat)
|
||||
const int scale = cursor->is_custom ? cursor->custom_scale : seat->pointer.theme_scale;
|
||||
const int32_t hotspot_x = int32_t(cursor->wl.image.hotspot_x) / scale;
|
||||
const int32_t hotspot_y = int32_t(cursor->wl.image.hotspot_y) / scale;
|
||||
if (seat->wl.pointer) {
|
||||
wl_pointer_set_cursor(
|
||||
seat->wl.pointer, seat->pointer.serial, cursor->wl.surface_cursor, hotspot_x, hotspot_y);
|
||||
}
|
||||
wl_pointer_set_cursor(
|
||||
seat->wl.pointer, seat->pointer.serial, cursor->wl.surface_cursor, hotspot_x, hotspot_y);
|
||||
}
|
||||
|
||||
if (!seat->wp.tablet_tools.empty()) {
|
||||
|
||||
@@ -1152,7 +1152,6 @@ void BKE_unit_name_to_alt(char *str, int str_maxncpy, const char *orig_str, int
|
||||
const char *found = unit_find_str(orig_str, unit->name_short, case_sensitive);
|
||||
if (found) {
|
||||
int offset = int(found - orig_str);
|
||||
int len_name = 0;
|
||||
|
||||
/* Copy everything before the unit. */
|
||||
if (offset < str_maxncpy) {
|
||||
@@ -1168,14 +1167,8 @@ void BKE_unit_name_to_alt(char *str, int str_maxncpy, const char *orig_str, int
|
||||
str_maxncpy -= offset;
|
||||
|
||||
/* Print the alt_name. */
|
||||
if (unit->name_alt) {
|
||||
len_name = BLI_strncpy_rlen(str, unit->name_alt, str_maxncpy);
|
||||
}
|
||||
else {
|
||||
len_name = 0;
|
||||
}
|
||||
|
||||
len_name = (len_name < str_maxncpy ? len_name : str_maxncpy);
|
||||
const int len_name = BLI_strncpy_rlen(str, unit->name_alt, str_maxncpy);
|
||||
BLI_assert(len_name < str_maxncpy);
|
||||
str += len_name;
|
||||
str_maxncpy -= len_name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user