From ff1ba1e770b4205c2cc367ff513325e5f22c73e8 Mon Sep 17 00:00:00 2001 From: Mubashshir Date: Mon, 19 May 2025 14:08:11 +0600 Subject: Code cleanup and reuse Signed-off-by: Mubashshir --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a42b5a6..650cf05 100644 --- a/src/main.c +++ b/src/main.c @@ -13,19 +13,19 @@ void process(ref(char) line, unsigned idx, team obj) unsigned s; switch(idx) { case 1: - set(team, obj, name, line); + set(obj, name, line); break; case 2: - set(team, obj, institution, line); + set(obj, institution, line); break; case 3: sscanf(line, "%u", &s); - set(team, obj, solved, s); + set(obj, solved, s); break; case 4: // falls through case 5: // falls through case 6: - set(team, obj, member_name, idx - 3, line); + set(obj, member_name, idx - 3, line); break; default: break; @@ -56,8 +56,8 @@ int main() } } - team champion = ask(team, find_champion, NULL, teams, num); - ask(team, printf, champion); + team champion = call(dref(teams), find_champion, teams, num); + call(champion, printf); while(num --) del(team, teams[num]); free(teams); -- cgit v1.2.3