File tree 2 files changed +11
-31
lines changed
2 files changed +11
-31
lines changed Original file line number Diff line number Diff line change @@ -347,45 +347,25 @@ func computeDistinct(kvs []KeyValue) Distinct {
347
347
func computeDistinctFixed (kvs []KeyValue ) interface {} {
348
348
switch len (kvs ) {
349
349
case 1 :
350
- ptr := new ([1 ]KeyValue )
351
- copy ((* ptr )[:], kvs )
352
- return * ptr
350
+ return [1 ]KeyValue (kvs )
353
351
case 2 :
354
- ptr := new ([2 ]KeyValue )
355
- copy ((* ptr )[:], kvs )
356
- return * ptr
352
+ return [2 ]KeyValue (kvs )
357
353
case 3 :
358
- ptr := new ([3 ]KeyValue )
359
- copy ((* ptr )[:], kvs )
360
- return * ptr
354
+ return [3 ]KeyValue (kvs )
361
355
case 4 :
362
- ptr := new ([4 ]KeyValue )
363
- copy ((* ptr )[:], kvs )
364
- return * ptr
356
+ return [4 ]KeyValue (kvs )
365
357
case 5 :
366
- ptr := new ([5 ]KeyValue )
367
- copy ((* ptr )[:], kvs )
368
- return * ptr
358
+ return [5 ]KeyValue (kvs )
369
359
case 6 :
370
- ptr := new ([6 ]KeyValue )
371
- copy ((* ptr )[:], kvs )
372
- return * ptr
360
+ return [6 ]KeyValue (kvs )
373
361
case 7 :
374
- ptr := new ([7 ]KeyValue )
375
- copy ((* ptr )[:], kvs )
376
- return * ptr
362
+ return [7 ]KeyValue (kvs )
377
363
case 8 :
378
- ptr := new ([8 ]KeyValue )
379
- copy ((* ptr )[:], kvs )
380
- return * ptr
364
+ return [8 ]KeyValue (kvs )
381
365
case 9 :
382
- ptr := new ([9 ]KeyValue )
383
- copy ((* ptr )[:], kvs )
384
- return * ptr
366
+ return [9 ]KeyValue (kvs )
385
367
case 10 :
386
- ptr := new ([10 ]KeyValue )
387
- copy ((* ptr )[:], kvs )
388
- return * ptr
368
+ return [10 ]KeyValue (kvs )
389
369
default :
390
370
return nil
391
371
}
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ func WithAttributeSet(attributes attribute.Set) MeasurementOption {
351
351
//
352
352
// cp := make([]attribute.KeyValue, len(attributes))
353
353
// copy(cp, attributes)
354
- // WithAttributes (attribute.NewSet(cp...))
354
+ // WithAttributeSet (attribute.NewSet(cp...))
355
355
//
356
356
// [attribute.NewSet] may modify the passed attributes so this will make a copy
357
357
// of attributes before creating a set in order to ensure this function is
You can’t perform that action at this time.
0 commit comments