mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
button: save a few cycles by returning early
...and in preparation for the merge-config patch, avoid building directory lists for empty filenames.
This commit is contained in:
parent
4238d7fc33
commit
d0aff49c81
3 changed files with 9 additions and 0 deletions
|
|
@ -22,6 +22,9 @@ button_svg_load(const char *button_name, struct lab_data_buffer **buffer,
|
|||
wlr_buffer_drop(&(*buffer)->base);
|
||||
*buffer = NULL;
|
||||
}
|
||||
if (!button_name || !*button_name) {
|
||||
return;
|
||||
}
|
||||
|
||||
char filename[4096] = { 0 };
|
||||
button_filename(button_name, filename, sizeof(filename));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue