JKorf / Bybit.Net

A C# .netstandard client library for the Bybit REST and Websocket V5 API focusing on clear usage and models
https://jkorf.github.io/Bybit.Net/
92 stars 64 forks source link

Reduce for loop complexity from O(N^2) to O(N) #213

Closed zhenkas closed 3 months ago

zhenkas commented 3 months ago

In this section the response array recreated on every item in response array meaning complexity O(N^2)

Can reduce to O(N) by taking this line before the loop https://github.com/JKorf/Bybit.Net/blob/1ef996ee167460027d5c746324e478aee7d9f821/ByBit.Net/Clients/V5/BybitRestClientApiTrading.cs#L146

JKorf commented 3 months ago

Makes sense, thanks for the PR