Indexing into an empty fixed iterator for logging purposes no longer crashes. Fixes #3.
This commit is contained in:
parent
3dae7c1d51
commit
7e52f6ce6e
1 changed files with 6 additions and 1 deletions
|
|
@ -84,12 +84,17 @@ func (f *FixedIterator) AddValue(v TSVal) {
|
|||
|
||||
// Print some information about the iterator.
|
||||
func (f *FixedIterator) DebugString(indent int) string {
|
||||
value := ""
|
||||
if len(f.values) > 0 {
|
||||
value = fmt.Sprint(f.values[0])
|
||||
}
|
||||
return fmt.Sprintf("%s(%s tags: %s Size: %d id0: %d)",
|
||||
strings.Repeat(" ", indent),
|
||||
f.Type(),
|
||||
f.FixedTags(),
|
||||
len(f.values),
|
||||
f.values[0])
|
||||
value,
|
||||
)
|
||||
}
|
||||
|
||||
// Register this iterator as a Fixed iterator.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue