We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (f *FastSort) Add(ids *[]uint32) { //f.Lock() //defer f.Unlock()
因为此方法是被并发调用的,所以可能会并发执行这一行,这样会导致Add的数据不正确 应该去除注释,改成:
func (f *FastSort) Add(ids *[]uint32) { f.Lock() defer f.Unlock() //for _, id := range *ids { // // found, index := f.find(&id) // if found { // f.data[index].Score += 1 // } else { // // f.data = append(f.data, model.SliceItem{ // Id: id, // Score: 1, // }) // f.Sort() // } //} //f.count = len(f.data) f.temps = append(f.temps, *ids...) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
因为此方法是被并发调用的,所以可能会并发执行这一行,这样会导致Add的数据不正确
应该去除注释,改成:
The text was updated successfully, but these errors were encountered: