Skip to content
Permalink
Browse files

better fix: clean up old code

  • Loading branch information...
Dieterbe committed Sep 18, 2019
1 parent 2953aa0 commit fc42376ca52f527249e44825d288ac015ce53817
Showing with 4 additions and 9 deletions.
  1. +2 −2 api/graphite.go
  2. +0 −4 api/models/graphite.go
  3. +2 −3 api/models/graphite_test.go
@@ -492,7 +492,7 @@ func findPickle(nodes []idx.Node, request models.GraphiteFind, fromUnix, toUnix
var treejsonContext = make(map[string]int)

func findTreejson(query string, nodes []idx.Node) models.SeriesTree {
tree := models.NewSeriesTree()
tree := models.SeriesTree{}
seen := make(map[string]struct{})

for _, g := range nodes {
@@ -530,7 +530,7 @@ func findTreejson(query string, nodes []idx.Node) models.SeriesTree {
}
tree.Add(&t)
}
return *tree
return tree
}

func (s *Server) metricsDelete(ctx *middleware.Context, req models.MetricsDelete) {
@@ -228,10 +228,6 @@ func NewSeriesPickleItem(path string, isLeaf bool, intervals [][]int64) SeriesPi

type SeriesTree []SeriesTreeItem

func NewSeriesTree() *SeriesTree {
return &SeriesTree{}
}

func (s *SeriesTree) Add(i *SeriesTreeItem) {
*s = append(*s, *i)
}
@@ -9,9 +9,8 @@ import (

func TestEmptySeriesTree(t *testing.T) {
// mimic what findTreejson does
tree := NewSeriesTree()
treev := *tree
out, err := json.Marshal(treev)
tree := SeriesTree{}
out, err := json.Marshal(tree)
if err != nil {
t.Error(err)
}

0 comments on commit fc42376

Please sign in to comment.
You can’t perform that action at this time.