Ticket #8033 (closed: fixed)
Change VectorHelper::getBinIndex to use a binary search
Reported by: | Russell Taylor | Owned by: | Russell Taylor |
---|---|---|---|
Priority: | minor | Milestone: | Release 3.0 |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Wenduo Zhou |
Description
Why this was implemented to do a linear search I don't know. I also don't know why it was home-brewed when upper_bound will essentially do the job.
Change History
comment:2 Changed 7 years ago by Russell Taylor
Re #8033. Update comments.
Changeset: a43bfb9f7e36f32e187bb52aa90ca86bb9f85c24
comment:3 Changed 7 years ago by Russell Taylor
- Status changed from inprogress to verify
- Resolution set to fixed
Testing is by inspection. The modified method is well covered by unit tests (not only the VectorHelperTest but others such as RunTest & SumEventsByLogValueTest, which failed when I locally tried inserting deliberate errors in the implementation).
comment:4 Changed 7 years ago by Wenduo Zhou
- Status changed from verify to verifying
- Tester set to Wenduo Zhou
comment:5 Changed 7 years ago by Wenduo Zhou
- Status changed from verifying to closed
The change of code is good.
comment:6 Changed 7 years ago by Wenduo Zhou
Merge remote-tracking branch 'origin/feature/8033_getbinindex_binary_search'
Full changeset: c50d2764d14281bf84a4072de9d7c31e378484eb
Re #8033. Change to a linear search to a binary one.
And use a standard algorithm instead of home-brewing it.
Changeset: 58e12bda874182d7c4d1178c318e74743ee6755a