Skip to content

Conversation

@starfalling
Copy link

耗时降低至原算法的 1/3 左右

@starfalling
Copy link
Author

40317ab 的提交是增加了性能测试以及程序正确性验证的程序


private static int quickFindInIndexBuffer(long ip2long_value, int start, int end) {
while(true){
int middle = (start + end) / 2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里相加会overflow吗?下面一句 bitwise 的作用是?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不会 overflow,因为IP库里面的这个数组个数是有限制的,这不是一个通用的快速查找算法,不需要做溢出判断

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants