Esempio n. 1
0
func slicifyRing(r *ring.Ring) {
	l := r.Len()
	s := make([]WindowData, 0, l)
	for i := 0; i < l; i++ {
		s = append(s, r.Value.(WindowData))
		r = r.Prev()
	}
}
Esempio n. 2
0
func slicifyRing(r *ring.Ring) {
	l := r.Len()
	s := make([]float64, 0, l)
	for i := 0; i < l; i++ {
		s = append(s, r.Value.(float64))
		r = r.Prev()
	}
}
Esempio n. 3
0
func (c *Cache) meta_del(r *ring.Ring) {

	delete(c.keys, r.Value.(*entry).key)

	if r == c.hand_hot {
		c.hand_hot = c.hand_hot.Prev()
	}

	if r == c.hand_cold {
		c.hand_cold = c.hand_cold.Prev()
	}

	if r == c.hand_test {
		c.hand_test = c.hand_test.Prev()
	}

	r.Prev().Unlink(1)
}