mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: deprecate the cache in constructor in NapProtoMsg
This commit is contained in:
parent
095f1c270b
commit
9304430889
@ -117,17 +117,12 @@ export class NapProtoMsg<T extends ProtoMessageType> {
|
|||||||
repeat: repeatType,
|
repeat: repeatType,
|
||||||
};
|
};
|
||||||
} else if (field.kind === 'message') {
|
} else if (field.kind === 'message') {
|
||||||
const rt = NapProtoMsgCache.get(field.type()) ?? (() => {
|
|
||||||
const msg = new NapProtoMsg(field.type());
|
|
||||||
NapProtoMsgCache.set(field.type(), msg._proto_msg);
|
|
||||||
return msg._proto_msg;
|
|
||||||
})();
|
|
||||||
return {
|
return {
|
||||||
no: field.no,
|
no: field.no,
|
||||||
name: key,
|
name: key,
|
||||||
kind: 'message',
|
kind: 'message',
|
||||||
repeat: field.repeat ? RepeatType.PACKED : RepeatType.NO,
|
repeat: field.repeat ? RepeatType.PACKED : RepeatType.NO,
|
||||||
T: () => rt,
|
T: () => new NapProtoMsg(field.type())._proto_msg,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}) as PartialFieldInfo[];
|
}) as PartialFieldInfo[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user