Skip to content

Commit 642c7d7

Browse files
committed
vendor: add golang-lru to dependencies
Signed-off-by: Miguel Molina <[email protected]>
1 parent 3ac3d44 commit 642c7d7

File tree

17 files changed

+2307
-12
lines changed

17 files changed

+2307
-12
lines changed

Gopkg.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
name = "github.com/jessevdk/go-flags"
77
version = "1.3.0"
88

9+
[[constraint]]
10+
name = "github.com/hashicorp/golang-lru"
11+
version = "0.5.0"
12+
913
[[constraint]]
1014
name = "github.com/stretchr/testify"
1115
version = "1.1.4"

internal/function/language.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,12 @@ func languageHash(filename string, blob []byte) [8]byte {
156156
return result
157157
}
158158

159-
const blobPeekSize = 40
160-
161159
func blobHash(blob []byte) []byte {
162160
if len(blob) == 0 {
163161
return nil
164162
}
165163

166-
var result []byte
167-
if len(blob) < blobPeekSize*2 {
168-
result = blob
169-
} else {
170-
result = make([]byte, 0, blobPeekSize*2)
171-
result = append(result, blob[:blobPeekSize]...)
172-
result = append(result, blob[len(blob)-blobPeekSize:]...)
173-
}
174-
175-
n := crc32.ChecksumIEEE(result)
164+
n := crc32.ChecksumIEEE(blob)
176165
hash := make([]byte, 4)
177166
binary.LittleEndian.PutUint32(hash, n)
178167
return hash

vendor/github.com/hashicorp/golang-lru/.gitignore

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/hashicorp/golang-lru/2q.go

Lines changed: 223 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)