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

Improve if statement readability and fix documentation typo #1133

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Improve if statement readability and fix documentation typo #1133

merged 3 commits into from
Apr 8, 2024

Conversation

dukbong
Copy link
Contributor

@dukbong dukbong commented Apr 8, 2024

Description of the new Feature/Bugfix

The pull request involves code modifications aimed at maintenance and readability improvements rather than introducing new features or fixing bugs. Specifically, I refactored the if statements to enhance code readability. Additionally, I corrected a typo in the documentation.

Related Issue: #

Unit-Tests for the new Feature/Bugfix

  • Unit-Tests added to reproduce the bug
  • Unit-Tests added to the added feature

Compatibilities Issues

The changes made for code maintenance do not introduce any compatibility issues. Method signatures remain unchanged, and existing functionalities are not affected.

Testing details

To verify the code maintenance improvements, review the modified code and ensure that the if statements are now easier to understand and maintain. Confirm that the documentation typo has been corrected. Although no new functionality is introduced, it's advisable to run existing unit tests to ensure that the changes have not inadvertently caused any regressions. Additionally, consider performing manual testing to validate the modifications thoroughly.

Comment

This is my first attempt at contributing to an open-source project. It's also a project I've been using lately, and as I'm currently studying code that's easier to maintain, I've tried applying some of those principles to the codebase. I understand you must be busy, but I would greatly appreciate it if you could provide any feedback or suggestions on the changes I've made. Thank you.

@dukbong dukbong closed this Apr 8, 2024
@dukbong dukbong reopened this Apr 8, 2024
Copy link

sonarqubecloud bot commented Apr 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@asturio
Copy link
Member

asturio commented Apr 8, 2024

Readability is very important. Thank you for your contribution.

@asturio asturio self-requested a review April 8, 2024 07:06
@asturio asturio merged commit 89538ee into LibrePDF:master Apr 8, 2024
7 checks passed
@asturio
Copy link
Member

asturio commented Apr 8, 2024

It's merged, but I corrected the formatting of the if's back, as the indentation was a little bit strange.
You wrote:

           if (b2 >= a1 && !(-3 <= d && d <= 3)) { 
                a2 = finddiff2(dataBp, offsetData, a1, rowpixels, pixel(dataBp, offsetData, a1));
                handleHorizontalMode(a0, a1, a2);
                a0 = a2;
                } else if (b2 >= a1) { 
                    putcode(vcodes[d + 3]);
                    a0 = a1;
                    } else { 
                        putcode(passcode);
                        a0 = b2;
                        }

but the formatting should be:

            if (b2 >= a1 && !(-3 <= d && d <= 3)) {
                a2 = finddiff2(dataBp, offsetData, a1, rowpixels, pixel(dataBp, offsetData, a1));
                handleHorizontalMode(a0, a1, a2);
                a0 = a2;
            } else if (b2 >= a1) {
                putcode(vcodes[d + 3]);
                a0 = a1;
            } else {
                putcode(passcode);
                a0 = b2;
            }

@dukbong
Copy link
Contributor Author

dukbong commented Apr 8, 2024

Thank you!
I didn't realize there was an indentation issue 😿
I'm really glad that the changes I made were incorporated into the code!!

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