Merge pull request #1651 from chenzebinm4/develop/bert

Repeat 'len(s)'.
This commit is contained in:
John Guo 2022-03-09 20:46:41 +08:00 committed by GitHub
commit 5ee297d999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,13 +57,13 @@ func IsNumeric(s string) bool {
if length == 0 {
return false
}
for i := 0; i < len(s); i++ {
for i := 0; i < length; i++ {
if s[i] == '-' && i == 0 {
continue
}
if s[i] == '.' {
dotCount++
if i > 0 && i < len(s)-1 {
if i > 0 && i < length-1 {
continue
} else {
return false