mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-03 15:55:20 -05:00
remove unnecessary memory allocation in uuid generation
This commit is contained in:
@@ -39,8 +39,9 @@ func (this *UUID) Next() *UUID {
|
||||
md5hash := md5.New()
|
||||
md5hash.Write(this.Bytes())
|
||||
md5hash.Write([]byte("16167dc8-16b6-4e6d-b8bb-65dd68113a81"))
|
||||
newid := new(UUID)
|
||||
for {
|
||||
newid, _ := ParseBytes(md5hash.Sum(nil))
|
||||
md5hash.Sum(newid[:0])
|
||||
if !newid.Equals(this) {
|
||||
return newid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user