Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
bobohume authored Sep 15, 2022
1 parent 953d143 commit 6cacaa8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions base/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type (

WorkIdQue struct { //workid que
workMap map[uint32]int
idelVec *vector.Vector
idelVec *vector.Vector[int]
id int
}

Expand Down Expand Up @@ -101,7 +101,7 @@ func ParseUUID(id int64) (ts int64, workerId int64, seq int64) {
//----------WorkIdQue----------//
func (w *WorkIdQue) Init(id int) {
w.workMap = make(map[uint32]int)
w.idelVec = vector.NewVector()
w.idelVec = &vector.Vector[int]{}
w.id = id
}

Expand All @@ -113,11 +113,10 @@ func (w *WorkIdQue) Add(val string) int {
}

if !w.idelVec.Empty() {
back := w.idelVec.Back()
nId = back.(int)
nId := w.idelVec.Back()
w.idelVec.PopBack()
w.workMap[nVal] = nId
return back.(int)
return nId
}

nId = w.id
Expand Down

0 comments on commit 6cacaa8

Please sign in to comment.