rpcsrv: deduplicate RunForErrors code

Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
Roman Khimov 2024-08-24 15:36:57 +03:00
parent d22bdd8369
commit f15a163cdf

View file

@ -33,9 +33,7 @@ type abstractBatch []abstract
// RunForErrors implements abstractResult interface.
func (ab abstractBatch) RunForErrors(f func(jsonErr *neorpc.Error)) {
for _, a := range ab {
if a.Error != nil {
f(a.Error)
}
a.RunForErrors(f)
}
}