bracket optimization

This commit is contained in:
FelixKratz 2021-10-10 19:35:32 +02:00
parent dc2ce74817
commit ee0d08c8db
2 changed files with 3 additions and 2 deletions

View file

@ -224,7 +224,7 @@ uint32_t bar_item_get_length(struct bar_item* bar_item) {
return text_get_length(&bar_item->icon)
+ text_get_length(&bar_item->label)
+ (bar_item->has_graph ? graph_get_length(&bar_item->graph) : 0)
+ (bar_item->has_alias ? alias_get_length(&bar_item->alias) : 0);
+ (bar_item->has_alias ? alias_get_length(&bar_item->alias) : 0) + 1;
}
uint32_t bar_item_get_height(struct bar_item* bar_item) {

View file

@ -41,7 +41,8 @@ uint32_t group_get_length(struct group* group) {
uint32_t length = 0;
for (int i = 1; i < group->num_members; i++) {
if (!group->members[i]->nospace || (group->members[i]->nospace && i == group->num_members - 1))
length += bar_item_get_length(group->members[i]);
if (group->members[i]->drawing)
length += bar_item_get_length(group->members[i]);
}
return length;
}