1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

clean(jce): remove ReadMapF.

This commit is contained in:
wdvxdr 2021-08-12 23:28:21 +08:00
parent 9814f5295d
commit 3ed9b8d698
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
2 changed files with 1 additions and 22 deletions

View File

@ -360,21 +360,6 @@ func (r *JceReader) ReadMap(i interface{}, tag int) {
}
}
func (r *JceReader) _ReadMapF(tag int, f func(interface{}, interface{})) {
if !r.skipToTag(tag) {
return
}
r.readHead()
s := r.ReadInt32(0)
for i := 0; i < int(s); i++ {
k := r.ReadAny(0)
v := r.ReadAny(1)
if k != nil {
f(k, v)
}
}
}
func (r *JceReader) readObject(t reflect.Type, tag int) reflect.Value {
switch t.Kind() {
case reflect.Int, reflect.Int16, reflect.Int32, reflect.Int64:

View File

@ -580,13 +580,7 @@ func (pkt *RequestDataVersion2) ToBytes() []byte {
func (pkt *RequestDataVersion2) ReadFrom(r *JceReader) {
pkt.Map = make(map[string]map[string][]byte)
// r.ReadMap(pkt.Map, 0)
r._ReadMapF(0, func(k interface{}, v interface{}) {
pkt.Map[k.(string)] = make(map[string][]byte)
for k2, v := range v.(map[interface{}]interface{}) {
pkt.Map[k.(string)][k2.(string)] = v.([]byte)
}
})
r.ReadMap(pkt.Map, 0)
}
func (pkt *SsoServerInfo) ReadFrom(r *JceReader) {