forked from p30928647/excelize
This avoid unnecessary byte/string conversion (#1541)
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
a246db6a40
commit
c232748400
|
@ -1220,7 +1220,7 @@ func printCommaSep(text string) string {
|
|||
if i > 0 && (length-i)%3 == 0 {
|
||||
target.WriteString(",")
|
||||
}
|
||||
target.WriteString(string(text[i]))
|
||||
target.WriteByte(text[i])
|
||||
}
|
||||
if len(subStr) == 2 {
|
||||
target.WriteString(".")
|
||||
|
|
6
table.go
6
table.go
|
@ -490,7 +490,7 @@ func (f *File) parseFilterExpression(expression string, tokens []string) ([]int,
|
|||
// expressions).
|
||||
conditional := 0
|
||||
c := tokens[3]
|
||||
if conditionFormat.Match([]byte(c)) {
|
||||
if conditionFormat.MatchString(c) {
|
||||
conditional = 1
|
||||
}
|
||||
expression1, token1, err := f.parseFilterTokens(expression, tokens[:3])
|
||||
|
@ -538,7 +538,7 @@ func (f *File) parseFilterTokens(expression string, tokens []string) ([]int, str
|
|||
}
|
||||
token := tokens[2]
|
||||
// Special handling for Blanks/NonBlanks.
|
||||
re := blankFormat.Match([]byte(strings.ToLower(token)))
|
||||
re := blankFormat.MatchString((strings.ToLower(token)))
|
||||
if re {
|
||||
// Only allow Equals or NotEqual in this context.
|
||||
if operator != 2 && operator != 5 {
|
||||
|
@ -563,7 +563,7 @@ func (f *File) parseFilterTokens(expression string, tokens []string) ([]int, str
|
|||
}
|
||||
// If the string token contains an Excel match character then change the
|
||||
// operator type to indicate a non "simple" equality.
|
||||
re = matchFormat.Match([]byte(token))
|
||||
re = matchFormat.MatchString(token)
|
||||
if operator == 2 && re {
|
||||
operator = 22
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue