Clone makes a shallow copy of the tracker. The different clones can be used independently from each other.
()
| 237 | // The different clones can be used independently from |
| 238 | // each other. |
| 239 | func (c *CostTracker) Clone() (*CostTracker, error) { |
| 240 | tracker := &CostTracker{ |
| 241 | Estimator: c.Estimator, |
| 242 | overloadTrackers: c.overloadTrackers, |
| 243 | Limit: c.Limit, |
| 244 | presenceTestHasCost: c.presenceTestHasCost, |
| 245 | } |
| 246 | return tracker, nil |
| 247 | } |
| 248 | |
| 249 | // ActualCost returns the runtime cost |
| 250 | func (c *CostTracker) ActualCost() uint64 { |
no outgoing calls