Move a couple helpers to parser where they're used
Vytautas Ĺ altenis vytas@rtfb.lt
Mon, 11 Apr 2016 11:51:16 +0300
M
block.go
→
block.go
@@ -1485,3 +1485,19 @@
p.renderParagraph(data[:i]) return i } + +func skipChar(data []byte, start int, char byte) int { + i := start + for i < len(data) && data[i] == char { + i++ + } + return i +} + +func skipUntilChar(text []byte, start int, char byte) int { + i := start + for i < len(text) && text[i] != char { + i++ + } + return i +}
M
html.go
→
html.go
@@ -216,24 +216,8 @@
return false, -1 } -func skipUntilChar(text []byte, start int, char byte) int { - i := start - for i < len(text) && text[i] != char { - i++ - } - return i -} - func skipSpace(tag []byte, i int) int { for i < len(tag) && isspace(tag[i]) { - i++ - } - return i -} - -func skipChar(data []byte, start int, char byte) int { - i := start - for i < len(data) && data[i] == char { i++ } return i