Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindFile: use std::lower_bound reduce the repeated code. #4372

Closed
wants to merge 1 commit into from

Conversation

JiYou
Copy link
Contributor

@JiYou JiYou commented Sep 15, 2018

Summary:

FindFile() and FindFileInRange() actually works as the same
of std::lower_bound(). Use std::lower_bound() to reduce the
repeated code.

  • change FindFile() and FindFileInRange() to use std::lower_bound()

Signed-off-by: JiYou jiyou09@gmail.com

@JiYou JiYou changed the title FindFile: change code to use lower_bound reduce the repeated code. FindFile: use lower_bound reduce the repeated code. Sep 15, 2018
@JiYou JiYou changed the title FindFile: use lower_bound reduce the repeated code. FindFile: use std::lower_bound reduce the repeated code. Sep 15, 2018
@JiYou JiYou force-pushed the find.file branch 3 times, most recently from 76a2063 to 351ae11 Compare September 18, 2018 03:20
Summary:

`FindFile()` and  `FindFileInRange()` actually works as the same
of `std::lower_bound()`. Use `std::lower_bound()` to reduce the
repeated code.

- change `FindFile()` and `FindFileInRange()` to `std::lower_bound()`

Signed-off-by: JiYou <jiyou09@gmail.com>
Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

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

seems right to me, thanks.

@ajkr
Copy link
Contributor

ajkr commented Sep 18, 2018

looks like somebody was practicing for an interview when writing the old code.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

ajkr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@JiYou JiYou deleted the find.file branch September 28, 2018 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants