Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Drop collapseSpace + transformBlocSize to 2

  • Loading branch information...
commit 7dcfef54ded956c89a7ba294a782c33920673c57 1 parent 70546be
@peterbourgon authored
Showing with 1 addition and 18 deletions.
  1. +1 −18 examples/content-addressable-store/cas.go
View
19 examples/content-addressable-store/cas.go
@@ -9,11 +9,10 @@ import (
)
const (
- transformBlockSize = 4 // grouping of chars per directory depth
+ transformBlockSize = 2 // grouping of chars per directory depth
)
func BlockTransform(s string) []string {
- s = collapseSpace(s)
sliceSize := len(s) / transformBlockSize
pathSlice := make([]string, sliceSize)
for i := 0; i < sliceSize; i++ {
@@ -55,22 +54,6 @@ func main() {
// s.Flush() // leave it commented out to see how data is kept on disk
}
-func collapseSpace(s string) string {
- s2 := []rune{}
- for _, c := range s {
- switch c {
- case ' ':
- case '\r':
- case '\n':
- case '\t':
- break
- default:
- s2 = append(s2, c)
- }
- }
- return string(s2)
-}
-
func md5sum(s string) string {
h := md5.New()
io.WriteString(h, s)
Please sign in to comment.
Something went wrong with that request. Please try again.