Skip to content

Commit

Permalink
remove debug prints and fix small blunder
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Dec 25, 2021
1 parent c89af37 commit 3f1ac04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions src/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ bool group_is_item_member(struct group* group, struct bar_item* item) {
}

void group_add_member(struct group* group, struct bar_item* item) {
printf("Adding: %s\n", item->name);
if (group_is_item_member(group, item)) return;
if (item->group && item->group->members && item->group->members[0] == item) {
for (int i = 1; i < item->group->num_members; i++) {
group_add_member(group, item->group->members[i]);
}
} else {
printf("Added: %s\n", item->name);
group->num_members++;
group->members = realloc(group->members, sizeof(struct bar_item*)*group->num_members);
group->members[group->num_members - 1] = item;
Expand Down
4 changes: 1 addition & 3 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ static void handle_domain_add(FILE* rsp, struct token domain, char* message) {
bar_item_set_type(bar_item, command.text[0]);
bar_item->position = position.text[0];
if (position.text[0] == POSITION_POPUP) {
char* pair = malloc(sizeof(char)*position.length);
memcpy(pair, position.text, position.length);
char* pair = string_copy(position.text);
struct key_value_pair key_value_pair = get_key_value_pair(pair, '.');
if (key_value_pair.key && key_value_pair.value) {
int item_index_for_name = bar_manager_get_item_index_for_name(&g_bar_manager, key_value_pair.value);
Expand Down Expand Up @@ -173,7 +172,6 @@ static void handle_domain_add(FILE* rsp, struct token domain, char* message) {
while (member.text && member.length > 0) {

int index = bar_manager_get_item_index_for_name(&g_bar_manager, member.text);
printf("Index for item %s, %d\n", member.text, index);
if (index >= 0)
group_add_member(bar_item->group, g_bar_manager.bar_items[index]);
else {
Expand Down

0 comments on commit 3f1ac04

Please sign in to comment.