forked from TrueCloudLab/frostfs-api-go
[#3] signature: Verify parts in parallel
Verify request/response parts in parallel Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
611f73ad0f
commit
73fde0e37c
4 changed files with 54 additions and 43 deletions
|
@ -1,17 +0,0 @@
|
|||
package collection
|
||||
|
||||
import "golang.org/x/exp/constraints"
|
||||
|
||||
// Max finds maximum value of items.
|
||||
func Max[T constraints.Ordered](items ...T) T {
|
||||
if len(items) == 0 {
|
||||
panic("failed to get max value: empty slice")
|
||||
}
|
||||
result := items[0]
|
||||
for i := 1; i < len(items); i++ {
|
||||
if items[i] > result {
|
||||
result = items[i]
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue