Newest is a convenience function that returns the newest delta, or nil if there are no deltas.
()
| 630 | // Newest is a convenience function that returns the newest delta, or |
| 631 | // nil if there are no deltas. |
| 632 | func (d Deltas) Newest() *Delta { |
| 633 | if n := len(d); n > 0 { |
| 634 | return &d[n-1] |
| 635 | } |
| 636 | return nil |
| 637 | } |
| 638 | |
| 639 | // copyDeltas returns a shallow copy of d; that is, it copies the slice but not |
| 640 | // the objects in the slice. This allows Get/List to return an object that we |
no outgoing calls