mirror of
https://github.com/minio/minio.git
synced 2025-11-23 11:07:50 -05:00
optimize Listen bucket notification implementation (#9444)
this commit avoids lots of tiny allocations, repeated channel creates which are performed when filtering the incoming events, unescaping a key just for matching. also remove deprecated code which is not needed anymore, avoids unexpected data structure transformations from the map to slice.
This commit is contained in:
@@ -60,6 +60,11 @@ func (rulesMap RulesMap) Remove(rulesMap2 RulesMap) {
|
||||
}
|
||||
}
|
||||
|
||||
// MatchSimple - returns true if matching object name and event name in rules map.
|
||||
func (rulesMap RulesMap) MatchSimple(eventName Name, objectName string) bool {
|
||||
return rulesMap[eventName].MatchSimple(objectName)
|
||||
}
|
||||
|
||||
// Match - returns TargetIDSet matching object name and event name in rules map.
|
||||
func (rulesMap RulesMap) Match(eventName Name, objectName string) TargetIDSet {
|
||||
return rulesMap[eventName].Match(objectName)
|
||||
|
||||
Reference in New Issue
Block a user