Overview
Comment: | [bits] fixed package documentation [bits] added tests for the bool-backed vector [diff] added a real test, commented out the visual debug aids [plaindiff] added comments, removed commented code, added a helper []line getter [math] removed math package as it is currently unused |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
d5adabf68e98857170abaad175c3d960 |
User & Date: | spaskalev on 2014-12-14 01:03:44 |
Other Links: | manifest | tags |
Context
2014-12-14
| ||
12:11 | Skip diagonals shorter than the current match check-in: e01b36769d user: spaskalev tags: trunk | |
01:03 | [bits] fixed package documentation [bits] added tests for the bool-backed vector [diff] added a real test, commented out the visual debug aids [plaindiff] added comments, removed commented code, added a helper []line getter [math] removed math package as it is currently unused check-in: d5adabf68e user: spaskalev tags: trunk | |
00:16 | Initial implementation of a diff program and required libraries check-in: be5950faa4 user: spaskalev tags: trunk | |
Changes
Modified src/0dev.org/bits/bits.go from [6b768844ff] to [415ad79153].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - + + |
|
︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | + + + + + | v[pos] = !v[pos] } // Returns the total number of elements supported by the vector func (v boolvector) Len() uint { return uint(len(v)) } func NewBool(size uint) Vector { var slice []bool = make([]bool, size) return boolvector(slice) } type vector []uint // Retrieves the bit at the designated position func (v vector) Peek(pos uint) bool { var slot, offset uint = at(pos) return (v[slot] & (1 << offset)) > 0 |
︙ | |||
69 70 71 72 73 74 75 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + - - - - - | } func at(pos uint) (uint, uint) { return pos / strconv.IntSize, pos % strconv.IntSize } // Create a new bit vector sized up to the desired number of elements |
Modified src/0dev.org/bits/bits_test.go from [c68b8d450a] to [3c67937d6c].
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + | package bits import ( "strconv" "testing" ) |
︙ |
Modified src/0dev.org/commands/plaindiff/main.go from [d48eb80ca4] to [f32b00c34a].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | - - - - - + - - - - - + + | var hd hashDiff hd.hash = fnv.New64a() hd.first = read(args[0], hd.hash) hd.second = read(args[1], hd.hash) var result diff.Delta = diff.Diff(&hd) |
︙ | |||
101 102 103 104 105 106 107 108 | 94 95 96 97 98 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 | + - + + + + + + + + + + | // A line-based diff.Interface implementation type hashDiff struct { first, second []line hash hash.Hash64 } // Required per diff.Interface func (h *hashDiff) Equal(i, j int) bool { |
︙ |
Modified src/0dev.org/diff/diff.go from [f9b64d21c6] to [bb37f97581].
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | Removed []Mark } // Diffs the provided data and returns e Delta struct // with added entries' indices in the second sequence and removed from the first func Diff(data Interface) Delta { var len1, len2 = data.Len() |
︙ |
Modified src/0dev.org/diff/diff_test.go from [6f1c8e9901] to [210041c492].
1 2 3 | 1 2 3 4 5 6 7 8 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - + + + + + - + - - - - + + + + + + + + - - - - - - - + + + + + + - - - + + - - - + + + - - + + - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - + + - + | package diff import ( |
Deleted src/0dev.org/math/math.go version [1a240e5264].
| - - - - - - - - - - - - - - - - |
|