nieco viac
This commit is contained in:
parent
34fa8cae4e
commit
55b04a94e7
@ -27,29 +27,13 @@ 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 long
|
unsigned long hash=0;
|
||||||
hash(unsigned char *str)
|
for(int i=0;target[i]!='\0';i++){
|
||||||
{
|
hash = ((hash << 5) + hash) + target[i]; /* hash * 33 + c */
|
||||||
unsigned long hash = 5381;
|
}
|
||||||
int c;
|
hash = hash%station->track_count;
|
||||||
|
|
||||||
while (c = *str++)
|
|
||||||
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
|
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
/* int i,len;
|
|
||||||
for(hash = i = 0; i <'\0' ; ++i)
|
|
||||||
{
|
|
||||||
hash += target[i];
|
|
||||||
hash += (hash << 10);
|
|
||||||
hash ^= (hash >> 6);
|
|
||||||
}
|
|
||||||
hash += (hash << 3);
|
|
||||||
hash ^= (hash >> 11);
|
|
||||||
hash += (hash << 15);
|
|
||||||
return hash;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void add_target_capacity(struct station* station,const char* target, int capacity){
|
void add_target_capacity(struct station* station,const char* target, int capacity){
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user