chore: optimize string search with Aho–Corasick algorithm (#1476)
* chore: optimize string search with Aho–Corasick algorithm * chore: optimize keywords replacer * fix: replacer bugs * chore: reorder members
This commit is contained in:
@@ -3,10 +3,6 @@ package syncx
|
||||
import "sync"
|
||||
|
||||
type (
|
||||
// SharedCalls is an alias of SingleFlight.
|
||||
// Deprecated: use SingleFlight.
|
||||
SharedCalls = SingleFlight
|
||||
|
||||
// SingleFlight lets the concurrent calls with the same key to share the call result.
|
||||
// For example, A called F, before it's done, B called F. Then B would not execute F,
|
||||
// and shared the result returned by F which called by A.
|
||||
@@ -37,12 +33,6 @@ func NewSingleFlight() SingleFlight {
|
||||
}
|
||||
}
|
||||
|
||||
// NewSharedCalls returns a SingleFlight.
|
||||
// Deprecated: use NewSingleFlight.
|
||||
func NewSharedCalls() SingleFlight {
|
||||
return NewSingleFlight()
|
||||
}
|
||||
|
||||
func (g *flightGroup) Do(key string, fn func() (interface{}, error)) (interface{}, error) {
|
||||
c, done := g.createCall(key)
|
||||
if done {
|
||||
|
||||
Reference in New Issue
Block a user