Skip to content

Use bitwise operations#1062

Merged
snuyanzin merged 2 commits intodatafaker-net:mainfrom
snuyanzin:bitwise
Jan 19, 2024
Merged

Use bitwise operations#1062
snuyanzin merged 2 commits intodatafaker-net:mainfrom
snuyanzin:bitwise

Conversation

@snuyanzin
Copy link
Collaborator

Replace some operations with bitwise operations since they in general a bit faster

@what-the-diff
Copy link

what-the-diff bot commented Jan 19, 2024

PR Summary

  • Enhanced randomness in Number.java
    A new condition has been added in the method handling number generation. Now, when the parameter specifying the number of digits amounts to 0, the system will automatically return a random integer.

  • Refined number range calculation in Number.java
    The 'randomNumber' method in the Number.java file has been updated. Modifications were implemented in the calculations for both the minimum (min) and maximum (max) number range. This improvement should lead to a more precise generation of random integers.

  • Conditional checks updated in FakeValuesService.java
    We've updated the conditions used to check the columnExpressions and fieldExpressions elements' tally in the FakeValuesService.java file. Now, the system scrutinizes whether these elements possess an even count. This modification facilitates accurate and enhanced data handling.

@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (020eebb) 92.23% compared to head (9bac77a) 92.23%.

Files Patch % Lines
.../java/net/datafaker/service/FakeValuesService.java 81.81% 0 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1062   +/-   ##
=========================================
  Coverage     92.23%   92.23%           
  Complexity     2764     2764           
=========================================
  Files           291      291           
  Lines          5536     5539    +3     
  Branches        599      599           
=========================================
+ Hits           5106     5109    +3     
  Misses          275      275           
  Partials        155      155           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

LGTM and all tests remain passing 🙂

@snuyanzin snuyanzin merged commit c7331b2 into datafaker-net:main Jan 19, 2024
@snuyanzin
Copy link
Collaborator Author

thanks for taking a look

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.

3 participants