Skip to content

Commit

Permalink
Merge pull request #32258 from bflad/bflad/wafv2-empty-schema-memory
Browse files Browse the repository at this point in the history
service/wafv2: Allocate memory once for emptySchema()
  • Loading branch information
ewbankkit authored Jun 28, 2023
2 parents a17ab54 + d73df20 commit eb62ec0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/service/wafv2/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/verify"
)

var listOfEmptyObjectSchema *schema.Schema = &schema.Schema{
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{},
},
}

func emptySchema() *schema.Schema {
return &schema.Schema{
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{},
},
}
return listOfEmptyObjectSchema
}

func ruleLabelsSchema() *schema.Schema {
Expand Down

0 comments on commit eb62ec0

Please sign in to comment.