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