Overview
Comment: | Implemented commands/pdc using predictor. Made predictor's Compressor(...) return an io.Writer. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c9f3a59cb6f8359e28b9333fb4f6a661 |
User & Date: | spaskalev on 2014-12-19 21:54:39 |
Other Links: | manifest | tags |
Context
2014-12-20
| ||
11:52 | [predictor] Removed the buffer from the context struct, allocate the input slice buffer on creation with make. check-in: 723ffeb1fd user: spaskalev tags: trunk | |
2014-12-19
| ||
21:54 | Implemented commands/pdc using predictor. Made predictor's Compressor(...) return an io.Writer. check-in: c9f3a59cb6 user: spaskalev tags: trunk | |
2014-12-16
| ||
23:29 | Removed err variable from compressor check-in: 0f4bc650d1 user: spaskalev tags: trunk | |
Changes
Added src/0dev.org/commands/pdc/main.go version [3c0c8016e1].
|
Modified src/0dev.org/commands/plaindiff/main.go from [f98671241a] to [b2d6e402f0].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | package main import ( diff "0dev.org/diff" "bufio" "fmt" "hash" "hash/fnv" "io" "os" ) |
︙ |
Modified src/0dev.org/predictor/predictor.go from [2cc1907fb9] to [c65cc5c256].
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + - + + + + + + + - + - + | type context struct { table [1 << 16]byte buffer [1 << 3]byte input []byte hash uint16 } type compressor func([]byte) error |
︙ | |||
99 100 101 102 103 104 105 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | + - + + - + - + + - + | return nil } return write } // A function type alias so that it can have methods attached to it |
︙ |
Modified src/0dev.org/predictor/predictor_test.go from [73a8f932ed] to [dd11cf49de].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | - + - + | func TestCompressorSample(t *testing.T) { var ( buf bytes.Buffer err error ) out := Compressor(&buf) |
︙ | |||
107 108 109 110 111 112 113 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | - + - + | var trace []byte = make([]byte, 0) for len(data) > 0 { if step <= len(data) { trace = append(trace, data[:step]...) |
︙ |