diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-12 12:56:17 +0900 |
commit | cd847affb79ea6438c9721635724efc6f58e2215 (patch) | |
tree | d1e631e3dca8832ee4c495924789f6697c3629cf /src/chunklist.go | |
parent | 7a2bc2cada971c7a390d09b0afda34780ff56fb6 (diff) |
Reorganize source code
Diffstat (limited to 'src/chunklist.go')
-rw-r--r-- | src/chunklist.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/chunklist.go b/src/chunklist.go index 73983b1d..571a59af 100644 --- a/src/chunklist.go +++ b/src/chunklist.go @@ -8,20 +8,20 @@ const ChunkSize int = 100 // Chunk is a list of Item pointers whose size has the upper limit of ChunkSize type Chunk []*Item // >>> []Item -// Transformer is a closure type that builds Item object from a pointer to a +// ItemBuilder is a closure type that builds Item object from a pointer to a // string and an integer -type Transformer func(*string, int) *Item +type ItemBuilder func(*string, int) *Item // ChunkList is a list of Chunks type ChunkList struct { chunks []*Chunk count int mutex sync.Mutex - trans Transformer + trans ItemBuilder } // NewChunkList returns a new ChunkList -func NewChunkList(trans Transformer) *ChunkList { +func NewChunkList(trans ItemBuilder) *ChunkList { return &ChunkList{ chunks: []*Chunk{}, count: 0, @@ -29,7 +29,7 @@ func NewChunkList(trans Transformer) *ChunkList { trans: trans} } -func (c *Chunk) push(trans Transformer, data *string, index int) { +func (c *Chunk) push(trans ItemBuilder, data *string, index int) { *c = append(*c, trans(data, index)) } |