Don't indirect map values

We already have reference behaviour, so this is not necessary.

This change highlighted fairly baroque architecture in mql that deserves
some attention; the use of channels is somewhat confusing.

Also rename LastResult to Result.
This commit is contained in:
kortschak 2014-07-02 12:08:49 +09:30
parent b89d4f392c
commit a1453da84e
15 changed files with 59 additions and 57 deletions

View file

@ -93,18 +93,18 @@ func (s *Session) ExecInput(input string, c chan interface{}, limit int) {
break
}
tags := make(map[string]graph.TSVal)
it.TagResults(&tags)
c <- &tags
it.TagResults(tags)
c <- tags
for it.NextResult() == true {
tags := make(map[string]graph.TSVal)
it.TagResults(&tags)
c <- &tags
it.TagResults(tags)
c <- tags
}
}
}
func (s *Session) ToText(result interface{}) string {
tags := *(result.(*map[string]graph.TSVal))
tags := result.(map[string]graph.TSVal)
out := fmt.Sprintln("****")
tagKeys := make([]string, len(tags))
s.currentQuery.treeifyResult(tags)
@ -127,7 +127,7 @@ func (s *Session) ToText(result interface{}) string {
}
func (s *Session) BuildJson(result interface{}) {
s.currentQuery.treeifyResult(*(result.(*map[string]graph.TSVal)))
s.currentQuery.treeifyResult(result.(map[string]graph.TSVal))
}
func (s *Session) GetJson() (interface{}, error) {