// trim removes all items whose timeout is before now.
trim removes all items whose timeout is before now.
// trim removes all items whose timeout is before now .
func (ttl *TTL) trim() (count int) {
	for curr, now := ttl.head, time.Now(); curr != nil; curr = ttl.head {
		if curr.timeoutAt.After(now) {
			break
		}
		item, removed := ttl.remove(curr.id)
		if !removed {
			break
		}
		count++
		if ttl.cb != nil {
			ttl.cb(curr.id, item.Value)
		}
	}
	return
}
func ( ttl * TTL ) trim ( ) ( count int ) { for curr , now := ttl . head , time . Now ( ) ; curr != nil ; curr = ttl . head { if curr . timeoutAt . After ( now ) { break } item , removed := ttl . remove ( curr . id ) if ! removed { break } count ++ if ttl . cb != nil { ttl . cb ( curr . id , item . Value ) } } return }
trim removes all items whose timeout is before now.
trim removes all items whose timeout is before now .