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

fix: remove duplicated initialization of rand #764

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

ulbqb
Copy link
Member

@ulbqb ulbqb commented Mar 11, 2024

Description

This PR removes duplicated initialization of rand.

Issue

func init() {
grand = NewRand()
grand.init()
}
func NewRand() *Rand {
rand := &Rand{}
rand.init()
return rand
}

rand.init() is run twice on init().

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.54%. Comparing base (2aa7d4c) to head (c4c4864).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #764      +/-   ##
==========================================
- Coverage   66.54%   66.54%   -0.01%     
==========================================
  Files         285      285              
  Lines       37919    37918       -1     
==========================================
- Hits        25232    25231       -1     
+ Misses      10883    10880       -3     
- Partials     1804     1807       +3     
Files Coverage Δ
libs/rand/random.go 65.66% <ø> (-0.21%) ⬇️

... and 10 files with indirect coverage changes

@ulbqb ulbqb self-assigned this Mar 11, 2024
@ulbqb ulbqb added the C: enhancement Classification: New feature or its request, or improvement in maintainability of code label Mar 11, 2024
@ulbqb ulbqb merged commit 1f5fb66 into Finschia:main Mar 11, 2024
23 checks passed
@ulbqb ulbqb deleted the fix/init_rand branch March 11, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants