nieco viac

This commit is contained in:
Radovan Kofira 2020-11-10 20:11:19 +01:00
parent 34fa8cae4e
commit 55b04a94e7

View File

@ -27,29 +27,13 @@ void destroy_station(struct station* station){
}
int select_track(struct station* station, const char* target){
unsigned long
hash(unsigned char *str)
{
unsigned long hash = 5381;
int c;
while (c = *str++)
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return hash;
unsigned long hash=0;
for(int i=0;target[i]!='\0';i++){
hash = ((hash << 5) + hash) + target[i]; /* hash * 33 + c */
}
/* int i,len;
for(hash = i = 0; i <'\0' ; ++i)
{
hash += target[i];
hash += (hash << 10);
hash ^= (hash >> 6);
hash = hash%station->track_count;
return hash;
}
hash += (hash << 3);
hash ^= (hash >> 11);
hash += (hash << 15);
return hash;*/
}
void add_target_capacity(struct station* station,const char* target, int capacity){
}