Thread (3 messages) read the whole thread 3 messages, 3 authors, 2017-10-25

Re: [PATCH] bus: skip useless iterations in rte_bus_find

From: Ferruh Yigit <hidden>
Date: 2017-10-24 00:18:33

On 8/29/2017 9:19 AM, Gaetan Rivet wrote:
The starting point is known. The iterator can be directly set to it.

The function rte_bus_find can easily be used with a comparison function
always returning True. This would make it a regular bus iterator.

Users doing so would however accomplish such iteration in

   O(N * N/2) = O(N^2)

Which can be avoided.

Signed-off-by: Gaetan Rivet <redacted>
---

In practice, such cost is entirely negligible of course.
It is cleaner and more correct though.
+1 for more clean approach

Reviewed-by: Ferruh Yigit <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help