From fb39e59e6b28fa734383c646b188e136ccae98dc Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Tue, 1 Jan 2019 18:52:46 +0100 Subject: [PATCH] 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 --- org/document.go | 3 +-- org/table.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/org/document.go b/org/document.go index 34fad76..e3a7b81 100644 --- a/org/document.go +++ b/org/document.go @@ -16,7 +16,6 @@ type Document struct { Nodes []Node Footnotes Footnotes Outline Outline - StatusKeywords []string MaxEmphasisNewLines int AutoLink bool 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.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 return d } diff --git a/org/table.go b/org/table.go index 6e391cc..b31cfba 100644 --- a/org/table.go +++ b/org/table.go @@ -86,7 +86,7 @@ func getColumnInfos(rows [][]string) []ColumnInfo { for i := 0; i < columnCount; i++ { countNumeric, countNonNumeric := 0, 0 for _, columns := range rows { - if !(i < len(columns)) { + if i >= len(columns) { continue }