cosmetics

This commit is contained in:
Michael Teichgräber 2012-04-30 00:58:06 +02:00
parent 4071eb731f
commit 1bbd55c017
2 changed files with 4 additions and 3 deletions

View File

@ -160,8 +160,8 @@ func (p *Parser) preformat(r io.Reader) (s string) {
break
}
i0 := 0
for i := range buf[:n] {
switch buf[i] {
for i, c := range buf[:n] {
switch c {
case '\t':
b.Write(buf[i0:i])
for ; charstotab > 0; charstotab-- {

View File

@ -86,6 +86,7 @@ func (w *htmlOut) str(s string) *htmlOut {
var ws string
var i0 = 0
o := w.obfuscate
for i, r := range s {
switch r {
case '&':
@ -97,7 +98,7 @@ func (w *htmlOut) str(s string) *htmlOut {
case '"':
ws = """
default:
if w.obfuscate {
if o {
if rand.Intn(2) == 0 {
ws = fmt.Sprintf("&#%d;", r)
} else {