Skip to content

Commit

Permalink
Drop collapseSpace + transformBlocSize to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Apr 1, 2012
1 parent 70546be commit 7dcfef5
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions examples/content-addressable-store/cas.go
Expand Up @@ -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++ {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7dcfef5

Please sign in to comment.