Skip to content

refactor: avoid unnecessary alloc by using unwrap_or_else#3742

Merged
fengjiachun merged 1 commit intoGreptimeTeam:mainfrom
etolbakov:chore-promql-parameterize-lookback
Apr 19, 2024
Merged

refactor: avoid unnecessary alloc by using unwrap_or_else#3742
fengjiachun merged 1 commit intoGreptimeTeam:mainfrom
etolbakov:chore-promql-parameterize-lookback

Conversation

@etolbakov
Copy link
Copy Markdown
Collaborator

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#3453
#3630

What's changed and what's your intention?

improve the implementation by avoid an allocation if the lookback value is provided.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@etolbakov etolbakov requested a review from a team as a code owner April 18, 2024 20:09
@github-actions github-actions Bot added the docs-not-required This change does not impact docs. label Apr 18, 2024
@etolbakov
Copy link
Copy Markdown
Collaborator Author

@killme2008 @waynexia @tisonkun
Could you please take a look when you have time?

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 85.13%. Comparing base (314f270) to head (8eebd91).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3742      +/-   ##
==========================================
- Coverage   85.46%   85.13%   -0.33%     
==========================================
  Files         966      966              
  Lines      162498   162506       +8     
==========================================
- Hits       138871   138348     -523     
- Misses      23627    24158     +531     

@tisonkun tisonkun changed the title feat(promql): address post-merge CR refactor: avoid unnecessary alloc by using unwrap_or_else Apr 18, 2024
@tisonkun tisonkun requested review from killme2008 and waynexia April 18, 2024 23:27
@tisonkun
Copy link
Copy Markdown
Collaborator

Thank you!

@tisonkun
Copy link
Copy Markdown
Collaborator

I update the PR title. We're now generating release notes from PR title, so keeping it clear and expressive is important :D

Copy link
Copy Markdown
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

@fengjiachun fengjiachun added this pull request to the merge queue Apr 19, 2024
Merged via the queue into GreptimeTeam:main with commit 2114b15 Apr 19, 2024
@etolbakov etolbakov deleted the chore-promql-parameterize-lookback branch April 19, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants