feat: upgrade syncthing version

This commit is contained in:
naison
2024-10-09 11:57:22 +00:00
parent 4d075b29b3
commit 605fe047ca
798 changed files with 57663 additions and 29024 deletions

View File

@@ -14,12 +14,9 @@
package model
import (
"bytes"
"encoding/json"
"fmt"
"slices"
"sort"
"strconv"
)
// A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet
@@ -131,29 +128,6 @@ func (l LabelSet) Merge(other LabelSet) LabelSet {
return result
}
// String will look like `{foo="bar", more="less"}`. Names are sorted alphabetically.
func (l LabelSet) String() string {
var lna [32]LabelName // On stack to avoid memory allocation for sorting names.
labelNames := lna[:0]
for name := range l {
labelNames = append(labelNames, name)
}
slices.Sort(labelNames)
var bytea [1024]byte // On stack to avoid memory allocation while building the output.
b := bytes.NewBuffer(bytea[:0])
b.WriteByte('{')
for i, name := range labelNames {
if i > 0 {
b.WriteString(", ")
}
b.WriteString(string(name))
b.WriteByte('=')
b.Write(strconv.AppendQuote(b.AvailableBuffer(), string(l[name])))
}
b.WriteByte('}')
return b.String()
}
// Fingerprint returns the LabelSet's fingerprint.
func (ls LabelSet) Fingerprint() Fingerprint {
return labelSetToFingerprint(ls)