From 4d6d4025209542d7177d4b5a08024da9f8989667 Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 24 Mar 2015 15:18:47 +0800 Subject: [PATCH] update godep --- Godeps/Godeps.json | 4 --- .../github.com/siddontang/go/arena/arena.go | 30 ------------------- .../siddontang/go/arena/arena_test.go | 28 ----------------- 3 files changed, 62 deletions(-) delete mode 100644 Godeps/_workspace/src/github.com/siddontang/go/arena/arena.go delete mode 100644 Godeps/_workspace/src/github.com/siddontang/go/arena/arena_test.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 0f9a139..2773e88 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -22,10 +22,6 @@ "ImportPath": "github.com/edsrzf/mmap-go", "Rev": "6c75090c55983bef2e129e173681b20d24871ef8" }, - { - "ImportPath": "github.com/siddontang/go/arena", - "Rev": "c2b33271306fcb7c6532efceac33ec45ee2439e0" - }, { "ImportPath": "github.com/siddontang/go/bson", "Rev": "c2b33271306fcb7c6532efceac33ec45ee2439e0" diff --git a/Godeps/_workspace/src/github.com/siddontang/go/arena/arena.go b/Godeps/_workspace/src/github.com/siddontang/go/arena/arena.go deleted file mode 100644 index 2ca98aa..0000000 --- a/Godeps/_workspace/src/github.com/siddontang/go/arena/arena.go +++ /dev/null @@ -1,30 +0,0 @@ -package arena - -type Arena struct { - buf []byte - - offset int -} - -func NewArena(size int) *Arena { - a := new(Arena) - - a.buf = make([]byte, size, size) - a.offset = 0 - - return a -} - -func (a *Arena) Make(size int) []byte { - if len(a.buf) < size || len(a.buf)-a.offset < size { - return make([]byte, size) - } - - b := a.buf[a.offset : size+a.offset] - a.offset += size - return b -} - -func (a *Arena) Reset() { - a.offset = 0 -} diff --git a/Godeps/_workspace/src/github.com/siddontang/go/arena/arena_test.go b/Godeps/_workspace/src/github.com/siddontang/go/arena/arena_test.go deleted file mode 100644 index 607b2a4..0000000 --- a/Godeps/_workspace/src/github.com/siddontang/go/arena/arena_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package arena - -import ( - "fmt" - "testing" -) - -func TestArena(t *testing.T) { - a := NewArena(100) - - for i := 0; i < 50; i++ { - a.buf[i] = 1 - } - - for i := 50; i < 100; i++ { - a.buf[i] = 2 - } - - b1 := a.Make(50) - - b2 := a.Make(30) - - b3 := a.Make(40) - - fmt.Printf("%p %d\n", b1, b1[49]) - fmt.Printf("%p %d\n", b2, b2[29]) - fmt.Printf("%p %d\n", b3, b3[39]) -}