提交 db0ab163 编写于 作者: C chenjiandongx

Remove unnessary zero length

上级 c1f38e5c
......@@ -57,7 +57,7 @@ func (r *Reader) StartRead() {
var readCnt, readSwp int64
var dropCnt, dropSwp int64
analysClose := make(chan int, 0)
analysClose := make(chan int)
go func() {
for {
// 十秒钟统计一次
......
......@@ -14,7 +14,7 @@ var (
)
func init() {
globalStrategy = make(map[int64]*stra.Strategy, 0)
globalStrategy = make(map[int64]*stra.Strategy)
}
func Update() error {
......@@ -22,7 +22,7 @@ func Update() error {
err := UpdateGlobalStrategy(strategies)
if err != nil {
logger.Errorf("Update Strategy cache error ! [msg:%v]", err)
logger.Errorf("Update Strategy cache error:%v\n", err)
return err
}
logger.Infof("Update Strategy end")
......@@ -30,7 +30,7 @@ func Update() error {
}
func UpdateGlobalStrategy(sts []*stra.Strategy) error {
tmpStrategyMap := make(map[int64]*stra.Strategy, 0)
tmpStrategyMap := make(map[int64]*stra.Strategy)
for _, st := range sts {
if st.Degree == 0 {
st.Degree = 6
......
......@@ -25,7 +25,7 @@ type pushPointsCache struct {
Counters map[string]*counterCache `json:"counters"`
}
var globalPushPoints = pushPointsCache{Counters: make(map[string]*counterCache, 0)}
var globalPushPoints = pushPointsCache{Counters: make(map[string]*counterCache)}
func init() {
go CleanLoop()
......
......@@ -253,7 +253,7 @@ func (sc *StrategyCounter) AddTms(tms int64) error {
_, ok := sc.TmsPoints[tms]
if !ok {
tmp := new(PointsCounter)
tmp.TagstringMap = make(map[string]*PointCounter, 0)
tmp.TagstringMap = make(map[string]*PointCounter)
sc.TmsPoints[tms] = tmp
}
sc.Unlock()
......@@ -300,7 +300,7 @@ func (gc *GlobalCounter) AddStrategyCount(st *stra.Strategy) {
if _, ok := gc.StrategyCounts[st.ID]; !ok {
tmp := new(StrategyCounter)
tmp.Strategy = st
tmp.TmsPoints = make(map[int64]*PointsCounter, 0)
tmp.TmsPoints = make(map[int64]*PointsCounter)
gc.StrategyCounts[st.ID] = tmp
}
gc.Unlock()
......@@ -348,7 +348,7 @@ func (gc *GlobalCounter) cleanStrategyData(id int64) {
if !ok || sCount == nil {
return
}
sCount.TmsPoints = make(map[int64]*PointsCounter, 0)
sCount.TmsPoints = make(map[int64]*PointsCounter)
return
}
......
......@@ -165,7 +165,7 @@ func ToPushQueue(strategy *stra.Strategy, tms int64, pointMap map[string]*PointC
var tags map[string]string
if tagstring == "null" {
tags = make(map[string]string, 0)
tags = make(map[string]string)
} else {
tags = dataobj.DictedTagstring(tagstring)
}
......
......@@ -136,7 +136,7 @@ func (w *Worker) Work() {
logger.Infof("worker starting...[%s]", w.Mark)
var anaCnt, anaSwp int64
analysClose := make(chan int, 0)
analysClose := make(chan int)
go func() {
for {
......
......@@ -165,7 +165,7 @@ func parsePattern(strategies []*Strategy) {
func updateRegs(strategies []*Strategy) {
for _, st := range strategies {
st.TagRegs = make(map[string]*regexp.Regexp, 0)
st.TagRegs = make(map[string]*regexp.Regexp)
st.ParseSucc = false
//更新时间正则
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册