(e ast.Expr)
| 605 | } |
| 606 | |
| 607 | func (c *coster) costCreateList(e ast.Expr) CostEstimate { |
| 608 | create := e.AsList() |
| 609 | var sum CostEstimate |
| 610 | itemSize := SizeEstimate{Min: math.MaxUint64, Max: 0} |
| 611 | if create.Size() == 0 { |
| 612 | itemSize.Min = 0 |
| 613 | } |
| 614 | for _, e := range create.Elements() { |
| 615 | sum = sum.Add(c.cost(e)) |
| 616 | is := c.sizeOrUnknown(e) |
| 617 | itemSize = itemSize.Union(is) |
| 618 | } |
| 619 | c.setEntrySize(e, &entrySizeEstimate{containerKind: types.ListKind, key: FixedSizeEstimate(1), val: itemSize}) |
| 620 | return sum.Add(createListBaseCost) |
| 621 | } |
| 622 | |
| 623 | func (c *coster) costCreateMap(e ast.Expr) CostEstimate { |
| 624 | mapVal := e.AsMap() |
no test coverage detected