From 46c1d7418376bce76b51eb5d2f3ead0236d0ea36 Mon Sep 17 00:00:00 2001 From: Bohdan Kapliuk Date: Sun, 3 Nov 2024 17:04:43 +0200 Subject: [PATCH] cv6 --- cv6/a_station.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cv6/a_station.c b/cv6/a_station.c index a1cea9f..8baf409 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -27,7 +27,12 @@ void destroy_station(struct station* station){ } int select_track(struct station* station, const char* target){ - return 0; + unsigned long hash = 5381; + int c; + while (c = *str++) + hash = ((hash << 5) + hash) + c; + + return hash; } void add_target_capacity(struct station* station,const char* target, int capacity){