Unexport ValCount.Smaller

This commit is contained in:
Cody Soyland 2018-07-05 21:56:16 -05:00
parent d7cebfa7c4
commit ffde862679

View file

@ -267,7 +267,7 @@ func (e *executor) executeMin(ctx context.Context, index string, c *pql.Call, sh
// Merge returned results at coordinating node.
reduceFn := func(prev, v interface{}) interface{} {
other, _ := prev.(ValCount)
return other.Smaller(v.(ValCount))
return other.smaller(v.(ValCount))
}
result, err := e.mapReduce(ctx, index, shards, c, opt, mapFn, reduceFn)
@ -1720,8 +1720,8 @@ func (vc *ValCount) add(other ValCount) ValCount {
}
}
// Smaller returns the smaller of the two ValCounts.
func (vc *ValCount) Smaller(other ValCount) ValCount {
// smaller returns the smaller of the two ValCounts.
func (vc *ValCount) smaller(other ValCount) ValCount {
if vc.Count == 0 || (other.Val < vc.Val && other.Count > 0) {
return other
}