listJoinCostModel models l.join(): it reads the list once and builds the concatenated result.
(id string)
| 967 | |
| 968 | // listJoinCostModel models l.join(): it reads the list once and builds the concatenated result. |
| 969 | func listJoinCostModel(id string) cost.OverloadModel { |
| 970 | return cost.MemberOverload(id, |
| 971 | cost.EvalCost(cost.Sum(cost.Const(cost.CallCost), cost.StringScan(cost.Sum(cost.Length(cost.Target()), cost.Const(1))), cost.Length(cost.Result()))), |
| 972 | cost.ResultSize(cost.AtMost(cost.ElemTotal(cost.Target()))), |
| 973 | cost.BeforeVersion(1, cost.ResultSize(cost.AtMost(cost.Length(cost.Target())))), |
| 974 | ) |
| 975 | } |
| 976 | |
| 977 | // listJoinStringCostModel models l.join(delim): it reads the list once and builds the result with |
| 978 | // delimiters between elements. |
no test coverage detected