mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
src: prefer 'if' over 'goto' where convenient
'goto' should not be used for normal control flow. v2 add comment in lieu of goto label
This commit is contained in:
parent
8b7ae52a91
commit
b48c250177
2 changed files with 23 additions and 25 deletions
|
|
@ -543,20 +543,19 @@ ssd_update_button_hover(struct wlr_scene_node *node,
|
|||
struct ssd_hover_state *hover_state)
|
||||
{
|
||||
struct ssd_button *button = NULL;
|
||||
if (!node || !node->data) {
|
||||
goto disable_old_hover;
|
||||
}
|
||||
|
||||
struct node_descriptor *desc = node->data;
|
||||
if (desc->type == LAB_NODE_DESC_SSD_BUTTON) {
|
||||
button = node_ssd_button_from_node(node);
|
||||
if (button == hover_state->button) {
|
||||
/* Cursor is still on the same button */
|
||||
return;
|
||||
if (node && node->data) {
|
||||
struct node_descriptor *desc = node->data;
|
||||
if (desc->type == LAB_NODE_DESC_SSD_BUTTON) {
|
||||
button = node_ssd_button_from_node(node);
|
||||
if (button == hover_state->button) {
|
||||
/* Cursor is still on the same button */
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disable_old_hover:
|
||||
/* Disable old hover */
|
||||
if (hover_state->button) {
|
||||
update_button_state(hover_state->button, LAB_BS_HOVERD, false);
|
||||
hover_state->view = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue