mirror of
https://github.com/rclone/rclone.git
synced 2025-12-15 15:53:41 +00:00
build: drop support for go1.8
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
//+build !go1.9
|
||||
|
||||
package fstests
|
||||
|
||||
func leadingZeros64(x uint64) int {
|
||||
var n uint64 = 64
|
||||
|
||||
if y := x >> 32; y != 0 {
|
||||
n = n - 32
|
||||
x = y
|
||||
}
|
||||
if y := x >> 16; y != 0 {
|
||||
n = n - 16
|
||||
x = y
|
||||
}
|
||||
if y := x >> 8; y != 0 {
|
||||
n = n - 8
|
||||
x = y
|
||||
}
|
||||
if y := x >> 4; y != 0 {
|
||||
n = n - 4
|
||||
x = y
|
||||
}
|
||||
if y := x >> 2; y != 0 {
|
||||
n = n - 2
|
||||
x = y
|
||||
}
|
||||
if y := x >> 1; y != 0 {
|
||||
return int(n - 2)
|
||||
}
|
||||
|
||||
return int(n - x)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
//+build go1.9
|
||||
|
||||
package fstests
|
||||
|
||||
import (
|
||||
"math/bits"
|
||||
)
|
||||
|
||||
func leadingZeros64(x uint64) int {
|
||||
return bits.LeadingZeros64(x)
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/bits"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@@ -72,7 +73,7 @@ type SetUploadCutoffer interface {
|
||||
// NextPowerOfTwo returns the current or next bigger power of two.
|
||||
// All values less or equal 0 will return 0
|
||||
func NextPowerOfTwo(i fs.SizeSuffix) fs.SizeSuffix {
|
||||
return 1 << uint(64-leadingZeros64(uint64(i)-1))
|
||||
return 1 << uint(64-bits.LeadingZeros64(uint64(i)-1))
|
||||
}
|
||||
|
||||
// NextMultipleOf returns a function that can be used as a CeilChunkSize function.
|
||||
|
||||
Reference in New Issue
Block a user