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

refactor: Rewrite convertImmutable #2445

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #2444

Description

Rewrites convertImmutable.

@AndrewSisley AndrewSisley added the code quality Related to improving code quality label Mar 21, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.11 milestone Mar 21, 2024
@AndrewSisley AndrewSisley requested a review from a team March 21, 2024 21:14
@AndrewSisley AndrewSisley self-assigned this Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.84%. Comparing base (75cf5ad) to head (c3561ac).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2445      +/-   ##
===========================================
+ Coverage    74.78%   74.84%   +0.06%     
===========================================
  Files          268      268              
  Lines        25928    25927       -1     
===========================================
+ Hits         19388    19403      +15     
+ Misses        5206     5193      -13     
+ Partials      1334     1331       -3     
Flag Coverage Δ
all-tests 74.84% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/value.go 93.18% <100.00%> (-0.15%) ⬇️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75cf5ad...c3561ac. Read the comment docs.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LOL at issue description It is too horrible 😆

LGTM

out := make([]any, len(vals))
for i := range vals {
if vals[i].HasValue() {
out[i] = vals[i].Value()
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: this is a small change with potentially significant impact. I wonder why no tests cover this.
Would be great to add some tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is tested, I was mistaken in your PR - I just rewrote it because it was really ugly

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this change has any impact other than improving the efficiency of the code. The returned result is the same.

@AndrewSisley AndrewSisley merged commit f253317 into sourcenetwork:develop Mar 21, 2024
32 of 33 checks passed
@AndrewSisley AndrewSisley deleted the 2444-convert-immutable branch March 21, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Related to improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite convertImmutable
4 participants