| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- shuffle() used Math.random() * i and swapped with i-1, which is a biased shuffle that cannot produce all permutations. Use standard Fisher-Yates over [0, i]. - rgbToHsl aliased the input array and overwrote it with HSL values. Copy the input first so callers keep their RGB data. Fixes TheAlgorithms#1867 Fixes TheAlgorithms#1907
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1912 +/- ##
=======================================
Coverage 85.91% 85.91%
=======================================
Files 379 379
Lines 19778 19778
Branches 3016 3015 -1
=======================================
Hits 16993 16993
Misses 2785 2785 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
BogoSort (Sorts/BogoSort.js)
The previous shuffle used Math.random() * i and swapped with index i - 1, which is a biased shuffle (some permutations never occur). Replaced with standard Fisher–Yates over [0, i].
RgbHslConversion (Conversions/RgbHslConversion.js)
rgbToHsl aliased the input array (let colorHsl = colorRgb) and wrote HSL values into it, destroying the caller’s RGB data. It now copies with .slice() first.
Verification
Fixes #1867
Fixes #1907