mirror of
https://github.com/fumiama/go-registry.git
synced 2026-06-21 19:13:19 +08:00
优化速度
This commit is contained in:
24
reg.go
24
reg.go
@@ -68,11 +68,11 @@ func (r *Regedit) Get(key string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ackbytes := ack.Decrypt(r.seq)
|
||||
if ackbytes == nil {
|
||||
err = ack.Decrypt(r.seq)
|
||||
if err != nil {
|
||||
return "", errors.New("decrypt ack error")
|
||||
}
|
||||
a := BytesToString(ackbytes)
|
||||
a := BytesToString(ack.data)
|
||||
r.seq++
|
||||
if a == "erro" {
|
||||
return "", errors.New("server ack error")
|
||||
@@ -100,11 +100,11 @@ func (r *Regedit) Set(key, value string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ackbytes := ack.Decrypt(r.seq)
|
||||
if ackbytes == nil {
|
||||
err = ack.Decrypt(r.seq)
|
||||
if err != nil {
|
||||
return errors.New("decrypt ack error")
|
||||
}
|
||||
a := BytesToString(ackbytes)
|
||||
a := BytesToString(ack.data)
|
||||
r.seq++
|
||||
if a == "erro" {
|
||||
return errors.New("server ack error")
|
||||
@@ -119,11 +119,11 @@ func (r *Regedit) Set(key, value string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ackbytes = ack.Decrypt(r.seq)
|
||||
if ackbytes == nil {
|
||||
err = ack.Decrypt(r.seq)
|
||||
if err != nil {
|
||||
return errors.New("decrypt ack error")
|
||||
}
|
||||
a = BytesToString(ackbytes)
|
||||
a = BytesToString(ack.data)
|
||||
r.seq++
|
||||
if a == "erro" {
|
||||
return errors.New("server ack error")
|
||||
@@ -148,11 +148,11 @@ func (r *Regedit) Del(key string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ackbytes := ack.Decrypt(r.seq)
|
||||
if ackbytes == nil {
|
||||
err = ack.Decrypt(r.seq)
|
||||
if err != nil {
|
||||
return errors.New("decrypt ack error")
|
||||
}
|
||||
a := BytesToString(ackbytes)
|
||||
a := BytesToString(ack.data)
|
||||
r.seq++
|
||||
if a == "erro" {
|
||||
return errors.New("server ack error")
|
||||
|
||||
Reference in New Issue
Block a user