Source file test/typeparam/issue48462.dir/a.go

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package a
     6  
     7  func Unique[T comparable](set []T) []T {
     8  	nset := make([]T, 0, 8)
     9  
    10  loop:
    11  	for _, s := range set {
    12  		for _, e := range nset {
    13  			if s == e {
    14  				continue loop
    15  			}
    16  		}
    17  
    18  		nset = append(nset, s)
    19  	}
    20  
    21  	return nset
    22  }
    23  

View as plain text