Skip to content

Commit 9f4e8cd

Browse files
authored
Merge branch 'main' into exemplar-no-global-rng
2 parents 289da3a + a7e83aa commit 9f4e8cd

File tree

2 files changed

+11
-31
lines changed

2 files changed

+11
-31
lines changed

attribute/set.go

+10-30
Original file line numberDiff line numberDiff line change
@@ -347,45 +347,25 @@ func computeDistinct(kvs []KeyValue) Distinct {
347347
func computeDistinctFixed(kvs []KeyValue) interface{} {
348348
switch len(kvs) {
349349
case 1:
350-
ptr := new([1]KeyValue)
351-
copy((*ptr)[:], kvs)
352-
return *ptr
350+
return [1]KeyValue(kvs)
353351
case 2:
354-
ptr := new([2]KeyValue)
355-
copy((*ptr)[:], kvs)
356-
return *ptr
352+
return [2]KeyValue(kvs)
357353
case 3:
358-
ptr := new([3]KeyValue)
359-
copy((*ptr)[:], kvs)
360-
return *ptr
354+
return [3]KeyValue(kvs)
361355
case 4:
362-
ptr := new([4]KeyValue)
363-
copy((*ptr)[:], kvs)
364-
return *ptr
356+
return [4]KeyValue(kvs)
365357
case 5:
366-
ptr := new([5]KeyValue)
367-
copy((*ptr)[:], kvs)
368-
return *ptr
358+
return [5]KeyValue(kvs)
369359
case 6:
370-
ptr := new([6]KeyValue)
371-
copy((*ptr)[:], kvs)
372-
return *ptr
360+
return [6]KeyValue(kvs)
373361
case 7:
374-
ptr := new([7]KeyValue)
375-
copy((*ptr)[:], kvs)
376-
return *ptr
362+
return [7]KeyValue(kvs)
377363
case 8:
378-
ptr := new([8]KeyValue)
379-
copy((*ptr)[:], kvs)
380-
return *ptr
364+
return [8]KeyValue(kvs)
381365
case 9:
382-
ptr := new([9]KeyValue)
383-
copy((*ptr)[:], kvs)
384-
return *ptr
366+
return [9]KeyValue(kvs)
385367
case 10:
386-
ptr := new([10]KeyValue)
387-
copy((*ptr)[:], kvs)
388-
return *ptr
368+
return [10]KeyValue(kvs)
389369
default:
390370
return nil
391371
}

metric/instrument.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func WithAttributeSet(attributes attribute.Set) MeasurementOption {
351351
//
352352
// cp := make([]attribute.KeyValue, len(attributes))
353353
// copy(cp, attributes)
354-
// WithAttributes(attribute.NewSet(cp...))
354+
// WithAttributeSet(attribute.NewSet(cp...))
355355
//
356356
// [attribute.NewSet] may modify the passed attributes so this will make a copy
357357
// of attributes before creating a set in order to ensure this function is

0 commit comments

Comments
 (0)