mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
♻️ Refactor av data structure
This commit is contained in:
parent
19fcd1a034
commit
1bc9a317a5
1 changed files with 4 additions and 4 deletions
|
|
@ -206,7 +206,7 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
|
||||||
|
|
||||||
if nil != value.MSelect && nil != other.MSelect && 0 < len(value.MSelect) && 0 < len(other.MSelect) {
|
if nil != value.MSelect && nil != other.MSelect && 0 < len(value.MSelect) && 0 < len(other.MSelect) {
|
||||||
switch operator {
|
switch operator {
|
||||||
case FilterOperatorIsEqual:
|
case FilterOperatorIsEqual, FilterOperatorContains:
|
||||||
contains := false
|
contains := false
|
||||||
for _, v := range value.MSelect {
|
for _, v := range value.MSelect {
|
||||||
for _, v2 := range other.MSelect {
|
for _, v2 := range other.MSelect {
|
||||||
|
|
@ -217,7 +217,7 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return contains
|
return contains
|
||||||
case FilterOperatorIsNotEqual:
|
case FilterOperatorIsNotEqual, FilterOperatorDoesNotContain:
|
||||||
contains := false
|
contains := false
|
||||||
for _, v := range value.MSelect {
|
for _, v := range value.MSelect {
|
||||||
for _, v2 := range other.MSelect {
|
for _, v2 := range other.MSelect {
|
||||||
|
|
@ -229,9 +229,9 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
|
||||||
}
|
}
|
||||||
return !contains
|
return !contains
|
||||||
case FilterOperatorIsEmpty:
|
case FilterOperatorIsEmpty:
|
||||||
return 0 == len(value.MSelect)
|
return 0 == len(value.MSelect) || 1 == len(value.MSelect) && "" == value.MSelect[0].Content
|
||||||
case FilterOperatorIsNotEmpty:
|
case FilterOperatorIsNotEmpty:
|
||||||
return 0 != len(value.MSelect)
|
return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue