Skip to content

Commit

Permalink
minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenjl committed Feb 11, 2015
1 parent c2f8e96 commit 4955f8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scanner.go
Expand Up @@ -237,6 +237,7 @@ func (this *Message) scanToken(data string) (int, TokenType, error) {
tnode *timeNode = timeFsmRoot
timeStop, macStop, macType bool
timeLen, tokenLen int
l = len(data)
)

this.state.dots = 0
Expand All @@ -245,13 +246,13 @@ func (this *Message) scanToken(data string) (int, TokenType, error) {

// short circuit the mac check
// positions 2,5,8,11,14 must be ':'
if len(data) < 17 || data[2] != ':' || data[14] != ':' {
if l < 17 || data[2] != ':' || data[14] != ':' {
macStop = true
macType = false
}

// short circuit the time check
if len(data) < minTimeLength {
if l < minTimeLength {
timeStop = true
}

Expand Down

0 comments on commit 4955f8e

Please sign in to comment.