Cleanup: Remove unused Document.StatusKeywords field & clean len checks

Leftover from the days before BufferSettings & DefaultSettings - now that those
exists the status keywords are actually defined in
- DefaultSettings["TODO"] for the default
- BufferSettings["TODO"] for any customizations

Also ! i < len => i >= len because it's easier on the eyes
This commit is contained in:
Niklas Fasching 2019-01-01 18:52:46 +01:00
parent d3d3b6c593
commit fb39e59e6b
2 changed files with 2 additions and 3 deletions

View file

@ -16,7 +16,6 @@ type Document struct {
Nodes []Node Nodes []Node
Footnotes Footnotes Footnotes Footnotes
Outline Outline Outline Outline
StatusKeywords []string
MaxEmphasisNewLines int MaxEmphasisNewLines int
AutoLink bool AutoLink bool
BufferSettings map[string]string BufferSettings map[string]string
@ -119,7 +118,7 @@ func (dIn *Document) Parse(input io.Reader) (d *Document) {
d.Error = fmt.Errorf("parse was called multiple times") d.Error = fmt.Errorf("parse was called multiple times")
} }
d.tokenize(input) d.tokenize(input)
_, nodes := d.parseMany(0, func(d *Document, i int) bool { return !(i < len(d.tokens)) }) _, nodes := d.parseMany(0, func(d *Document, i int) bool { return i >= len(d.tokens) })
d.Nodes = nodes d.Nodes = nodes
return d return d
} }

View file

@ -86,7 +86,7 @@ func getColumnInfos(rows [][]string) []ColumnInfo {
for i := 0; i < columnCount; i++ { for i := 0; i < columnCount; i++ {
countNumeric, countNonNumeric := 0, 0 countNumeric, countNonNumeric := 0, 0
for _, columns := range rows { for _, columns := range rows {
if !(i < len(columns)) { if i >= len(columns) {
continue continue
} }