nieco viac

This commit is contained in:
Radovan Kofira 2020-11-10 19:57:03 +01:00
parent 8c611f64bd
commit 328330c552

View File

@ -27,13 +27,16 @@ void destroy_station(struct station* station){
} }
int select_track(struct station* station, const char* target){ int select_track(struct station* station, const char* target){
unsigned char *str;
{
unsigned long hash = 0; unsigned long hash = 0;
int c; int c;
unsigned char *str;
while (c = *str++) while (c = *str++)
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ hash = c + (hash << 6) + (hash << 16) - hash;
return hash; return hash;
}
/* int i,len; /* int i,len;
for(hash = i = 0; i <'\0' ; ++i) for(hash = i = 0; i <'\0' ; ++i)
{ {