remove unneed byte()

This commit is contained in:
Miek Gieben 2012-02-19 19:57:01 +01:00
parent 9c5c2ee96f
commit c15712dbf6
1 changed files with 10 additions and 10 deletions

View File

@ -496,7 +496,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
l.value = _OWNER l.value = _OWNER
l.token = string(str[:stri]) l.token = string(str[:stri])
// escape $... start with a \ not a $, so this will work // escape $... start with a \ not a $, so this will work
switch string(str[:stri]) { switch l.token {
case "$TTL": case "$TTL":
l.value = _DIRTTL l.value = _DIRTTL
case "$ORIGIN": case "$ORIGIN":
@ -541,13 +541,13 @@ func zlexer(s scanner.Scanner, c chan lex) {
case ';': case ';':
if quote { if quote {
// Inside quotes this is legal // Inside quotes this is legal
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
break break
} }
if escape { if escape {
escape = false escape = false
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
break break
} }
@ -564,7 +564,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
case '\n': case '\n':
// Escaped newline // Escaped newline
if quote { if quote {
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
break break
} }
@ -612,12 +612,12 @@ func zlexer(s scanner.Scanner, c chan lex) {
break break
} }
if escape { if escape {
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
escape = false escape = false
break break
} }
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
escape = true escape = true
case '"': case '"':
@ -625,7 +625,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
break break
} }
if escape { if escape {
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
escape = false escape = false
break break
@ -644,7 +644,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
quote = !quote quote = !quote
case '(', ')': case '(', ')':
if quote { if quote {
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
break break
} }
@ -652,7 +652,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
break break
} }
if escape { if escape {
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
escape = false escape = false
break break
@ -673,7 +673,7 @@ func zlexer(s scanner.Scanner, c chan lex) {
break break
} }
escape = false escape = false
str[stri] = byte(x[0]) str[stri] = x[0]
stri++ stri++
space = false space = false
} }