From f5f65cef0e8c713ec4f3151f3c15d47498c51609 Mon Sep 17 00:00:00 2001 From: rrr523 Date: Sat, 23 Dec 2023 16:43:58 +0800 Subject: [PATCH] fix: SwapRows --- .changeset/large-camels-hear.md | 5 +++++ packages/reed-solomon/src/matrix.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/large-camels-hear.md diff --git a/.changeset/large-camels-hear.md b/.changeset/large-camels-hear.md new file mode 100644 index 00000000..05b0c181 --- /dev/null +++ b/.changeset/large-camels-hear.md @@ -0,0 +1,5 @@ +--- +'@bnb-chain/reed-solomon': patch +--- + +fix: SwapRows diff --git a/packages/reed-solomon/src/matrix.js b/packages/reed-solomon/src/matrix.js index d4fde507..84e1f731 100644 --- a/packages/reed-solomon/src/matrix.js +++ b/packages/reed-solomon/src/matrix.js @@ -125,7 +125,7 @@ function gaussianElimination(m) { if (m[r][r] === 0) { for (let rowBelow = r + 1; rowBelow < rows; rowBelow++) { if (m[rowBelow][r] !== 0) { - let err = SwapRows(r, rowBelow); + let err = SwapRows(m, r, rowBelow); if (err !== null) { return err; }