Skip to content

Commit

Permalink
no need for the reference to self
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshahid committed May 24, 2014
1 parent 696d61d commit 9ccc4af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cluster/cluster_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ func (self *ClusterConfiguration) GetShardToWriteToBySeriesAndTime(db, series st
if hasRandomSplit && splitRegex.MatchString(series) {
return matchingShards[self.random.Intn(len(matchingShards))], nil
}
index := self.HashDbAndSeriesToInt(db, series)
index := HashDbAndSeriesToInt(db, series)
index = index % len(matchingShards)
return matchingShards[index], nil
}
Expand Down Expand Up @@ -841,7 +841,7 @@ func (self *ClusterConfiguration) getShardRange(querySpec QuerySpec, shards []*S
return shards[startIndex : endIndex+startIndex]
}

func (self *ClusterConfiguration) HashDbAndSeriesToInt(database, series string) int {
func HashDbAndSeriesToInt(database, series string) int {
hasher := sha1.New()
hasher.Write([]byte(fmt.Sprintf("%s%s", database, series)))
buf := bytes.NewBuffer(hasher.Sum(nil))
Expand Down

0 comments on commit 9ccc4af

Please sign in to comment.