« get me outta code hell

Revert "data: withSortedList: return proper unstableSortIndices" - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-02-24 11:41:10 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-02-24 13:35:52 -0400
commit5bd2da3172114494fb61d9b5942771f387959fec (patch)
tree1a302438fd3f31e22dc36099d422ec14fffb4ab5 /src/data
parent8cb3aeb80de01a82f4f2309a21181b389419aef9 (diff)
Revert "data: withSortedList: return proper unstableSortIndices"
This reverts commit ac7ceacc2a9c0cdf78e7c9f060d46c6d83ddb7b3.

Because the original behavior is mayhaps correct!?
Diffstat (limited to 'src/data')
-rw-r--r--src/data/composite/data/withSortedList.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/data/composite/data/withSortedList.js b/src/data/composite/data/withSortedList.js
index c86d198..a7942ab 100644
--- a/src/data/composite/data/withSortedList.js
+++ b/src/data/composite/data/withSortedList.js
@@ -92,7 +92,7 @@ export default templateCompositeFrom({
         const sortedList =
           sortIndices.map(index => list[index]);
 
-        const unstableSortIndices =
+        const stableToUnstable =
           symbols
             .map((current, index) => {
               if (index === 0) {
@@ -117,6 +117,9 @@ export default templateCompositeFrom({
               return accumulator;
             }, [0]);
 
+        const unstableSortIndices =
+          sortIndices.map(stable => stableToUnstable[stable]);
+
         return continuation({
           ['#sortedList']: sortedList,
           ['#sortIndices']: sortIndices,