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

ENH Speed up DataObject::get_by_id by checking if there is an ID at all #10163

Merged
merged 1 commit into from
Jan 16, 2022

Conversation

sunnysideup
Copy link
Contributor

There is no point in preparing a database call when the ID value is lower than one.

@sunnysideup sunnysideup changed the title faster get_by_id MINOR: speed up DataObject::get_by_id by checking if there is an ID at all. Dec 1, 2021
@michalkleiner michalkleiner changed the title MINOR: speed up DataObject::get_by_id by checking if there is an ID at all. ENH Speed up DataObject::get_by_id by checking if there is an ID at all Dec 2, 2021
@michalkleiner
Copy link
Contributor

Thanks @sunnysideup, please fix the lint errors

3492 | ERROR | [x] Expected 1 space(s) after IF keyword; 0 found
3493 | ERROR | [x] Whitespace found at end of line

@sunnysideup
Copy link
Contributor Author

@michalkleiner - what would be really awesome is to have an automated linter go through this and clean it all up so we can focus on the important stuff. I am developing: https://github.com/sunnysideup/silverstripe-easy-coding-standards for this.

Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

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

Thanks @sunnysideup. I'm ready to merge this, can you please squash the commits into one and force push the update? Thanks!

PATCH: cleanup
@sunnysideup
Copy link
Contributor Author

sunnysideup commented Jan 15, 2022 via email

@michalkleiner michalkleiner merged commit d1cac48 into silverstripe:4 Jan 16, 2022
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