Dedent this code by doing an early return instead of if.

This commit is contained in:
voussoir 2020-04-02 16:25:19 -07:00
parent faf0c62426
commit 00ad82e07c

View file

@ -396,8 +396,9 @@ function add_searchtag(box, value, inputted_list, li_class)
remove_searchtag(box, existing_tag, inputted_list); remove_searchtag(box, existing_tag, inputted_list);
} }
} }
if (!already_have) if (already_have)
{ {return;}
inputted_list.push(value); inputted_list.push(value);
var new_li = document.createElement("li"); var new_li = document.createElement("li");
new_li.className = li_class; new_li.className = li_class;
@ -424,7 +425,6 @@ function add_searchtag(box, value, inputted_list, li_class)
// that thing go away. // that thing go away.
box.blur(); box.blur();
box.focus(); box.focus();
}
} }
function remove_searchtag(li_member, value, inputted_list) function remove_searchtag(li_member, value, inputted_list)
{ {