This commit is contained in:
Maryna Kravtsova 2020-11-07 16:52:33 +01:00
parent 9934c57259
commit 3734bd0fdb

View File

@ -27,12 +27,11 @@ void destroy_station(struct station* station){
int select_track(struct station* station, const char* target){
unsigned int hash = 0;
for(int i = 0; target[i] != '\0'; i++){
//i used "lose lose" function, because it's simple and clear
hash += target[i];
//hash = target[i] + (hash << 6) + (hash << 16) - hash;
}
//if(hash < 0 || hash > station->track_count){
//change hash, so that it will be between 0 and station->track_count
hash = hash % station->track_count;
//}
return hash;
}