1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

Integrate: fix float list helpers

This commit is contained in:
Sergey 2024-08-01 17:21:15 +02:00
parent 26e3ce3a04
commit 1fb76761f6
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6
3 changed files with 5 additions and 5 deletions

View file

@ -99,12 +99,12 @@ func (d *GenericMap[K]) GetStringList(key K) []string {
return d.Get(key).StringListOrDefault(nil)
}
func (d *GenericMap[K]) GetFloatList(key K) ([]float64, bool) {
func (d *GenericMap[K]) TryFloatList(key K) ([]float64, bool) {
return d.Get(key).FloatList()
}
func (d *GenericMap[K]) GetFloatListOrDefault(key K, def []float64) []float64 {
return d.Get(key).FloatListOrDefault(def)
func (d *GenericMap[K]) GetFloatList(key K) []float64 {
return d.Get(key).FloatListOrDefault(nil)
}
func (d *GenericMap[K]) ShallowCopy() *GenericMap[K] {

View file

@ -540,7 +540,7 @@ func (l FilterAllIn) FilterObject(g *domain.Details) bool {
}
// Float list
{
val, ok := g.GetFloatList(l.Key)
val, ok := g.TryFloatList(l.Key)
if ok {
return lo.Every(val, l.Floats)
}

View file

@ -16,7 +16,7 @@ type Set struct {
}
func NewFromState(st *state.State) *Set {
flags := st.Details().GetFloatListOrDefault(relationKey, nil)
flags := st.Details().GetFloatList(relationKey)
return &Set{
flags: slice.FloatsInto[int](flags),