mirror of https://github.com/anoshenko/rui.git
Optimisation
This commit is contained in:
parent
84c8c1e3d7
commit
5272354205
|
|
@ -2,6 +2,7 @@ package rui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -44,12 +45,10 @@ func (session *sessionData) constant(tag string, prevTags []string) (string, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = result[1:]
|
tag = result[1:]
|
||||||
for _, t := range tags {
|
if slices.Contains(tags, tag) {
|
||||||
if t == tag {
|
|
||||||
ErrorLogF(`"%v" constant is cyclic`, tag)
|
ErrorLogF(`"%v" constant is cyclic`, tag)
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
tags = append(tags, tag)
|
tags = append(tags, tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,12 +145,10 @@ func (session *sessionData) Color(tag string) (Color, bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = result[1:]
|
tag = result[1:]
|
||||||
for _, t := range tags {
|
if slices.Contains(tags, tag) {
|
||||||
if t == tag {
|
|
||||||
ErrorLogF(`"%v" color is cyclic`, tag)
|
ErrorLogF(`"%v" color is cyclic`, tag)
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
tags = append(tags, tag)
|
tags = append(tags, tag)
|
||||||
}
|
}
|
||||||
|
|
@ -172,12 +169,10 @@ func (session *sessionData) ImageConstant(tag string) (string, bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = result[1:]
|
tag = result[1:]
|
||||||
for _, t := range tags {
|
if slices.Contains(tags, tag) {
|
||||||
if t == tag {
|
|
||||||
ErrorLogF(`"%v" image is cyclic`, tag)
|
ErrorLogF(`"%v" image is cyclic`, tag)
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
tags = append(tags, tag)
|
tags = append(tags, tag)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue