refactor(s3api): drop redundant prefix normalization on read path

encodeBucketLifecycleTTLRules already normalizes rule.Prefix before it
hits the filer; matchBucketLifecycleTTLSeconds is on the per-object
hot path and shouldn't re-normalize.
This commit is contained in:
Chris Lu
2026-05-07 22:28:20 -07:00
parent 34922fd761
commit aaaf2fb53f

View File

@@ -72,7 +72,8 @@ func matchBucketLifecycleTTLSeconds(rules []bucketLifecycleTTLRule, objectKey st
var bestPrefix string
var ttlSeconds int32
for _, rule := range rules {
prefix := normalizeLifecycleRulePrefix(rule.Prefix)
// rule.Prefix is already normalized at encode time.
prefix := rule.Prefix
if prefix != "" && !strings.HasPrefix(objectKey, prefix) {
continue
}