From 0050d05880595d6906fad017b475c4229ecfe711 Mon Sep 17 00:00:00 2001 From: Michael Meier Date: Fri, 22 Jan 2010 23:20:59 +0100 Subject: [PATCH] added PopFront() method to *RTHostList --- lib/routing.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/routing.go b/lib/routing.go index ddfe4a4..30afc9c 100644 --- a/lib/routing.go +++ b/lib/routing.go @@ -103,6 +103,12 @@ func (l *RTHostList) Sort() { sort.Sort(l) } +func (l *RTHostList) PopFront() (h *RTHost) { + h = l.v.At(0).(*RTHost) + l.v.Cut(0, 0) + return +} + func (l *RTHostList) Data() []*RTHost { v := l.v vl := v.Len()