Combined function params (#10868)

Signed-off-by: Biki-das <bikid475@gmail.com>
pull/10879/head
BIKI DAS 2021-10-29 08:36:37 +05:30 committed by GitHub
parent b1d6d52c36
commit c41bc0dede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -205,7 +205,7 @@ func CalcHammingBatch(dim int64, left []byte, lIndex int64, right []byte, result
} }
} }
func CalcHammingDistance(dim int64, left []byte, right []byte) ([]int32, error) { func CalcHammingDistance(dim int64, left, right []byte) ([]int32, error) {
if dim <= 0 { if dim <= 0 {
err := errors.New("Invalid dimension") err := errors.New("Invalid dimension")
return nil, err return nil, err

View File

@ -313,7 +313,7 @@ func (gp *BaseTable) Load(key string) (string, error) {
return gp.params.Load(strings.ToLower(key)) return gp.params.Load(strings.ToLower(key))
} }
func (gp *BaseTable) LoadWithDefault(key string, defaultValue string) string { func (gp *BaseTable) LoadWithDefault(key, defaultValue string) string {
return gp.params.LoadWithDefault(strings.ToLower(key), defaultValue) return gp.params.LoadWithDefault(strings.ToLower(key), defaultValue)
} }

View File

@ -165,7 +165,7 @@ func LogError(span opentracing.Span, err error) {
} }
// InfoFromSpan is a method return span details. // InfoFromSpan is a method return span details.
func InfoFromSpan(span opentracing.Span) (traceID string, sampled bool, found bool) { func InfoFromSpan(span opentracing.Span) (traceID string, sampled, found bool) {
if span != nil { if span != nil {
if spanContext, ok := span.Context().(jaeger.SpanContext); ok { if spanContext, ok := span.Context().(jaeger.SpanContext); ok {
traceID = spanContext.TraceID().String() traceID = spanContext.TraceID().String()

View File

@ -16,7 +16,7 @@ import "github.com/milvus-io/milvus/internal/proto/commonpb"
// CompareIndexParams compares indexParam1 with indexParam2. When all keys of indexParam1 exist in indexParam2, // CompareIndexParams compares indexParam1 with indexParam2. When all keys of indexParam1 exist in indexParam2,
// and the corresponding value are the same as in indexParam2, return true // and the corresponding value are the same as in indexParam2, return true
// Otherwise return false // Otherwise return false
func CompareIndexParams(indexParam1 []*commonpb.KeyValuePair, indexParam2 []*commonpb.KeyValuePair) bool { func CompareIndexParams(indexParam1, indexParam2 []*commonpb.KeyValuePair) bool {
if indexParam1 == nil && indexParam2 == nil { if indexParam1 == nil && indexParam2 == nil {
return true return true
} }

View File

@ -35,6 +35,6 @@ func ParseTimestamp(data []byte) (time.Time, error) {
} }
// SubTimeByWallClock returns the duration between two different timestamps. // SubTimeByWallClock returns the duration between two different timestamps.
func SubTimeByWallClock(after time.Time, before time.Time) time.Duration { func SubTimeByWallClock(after, before time.Time) time.Duration {
return time.Duration(after.UnixNano() - before.UnixNano()) return time.Duration(after.UnixNano() - before.UnixNano())
} }