Skip to content

Commit 9edace1

Browse files
committed
Auto-generated commit
1 parent 90acce2 commit 9edace1

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ A total of 49 issues were closed in this release:
923923

924924
<details>
925925

926+
- [`31c91e5`](https://github.com/stdlib-js/stdlib/commit/31c91e5a0dc350a5c871d05e609340133413f36d) - **refactor:** simplify branching to optimize most common path _(by Athan Reines)_
926927
- [`ca19780`](https://github.com/stdlib-js/stdlib/commit/ca197805be0fc683e455e6beec112efa69297496) - **test:** add tests _(by Athan Reines)_
927928
- [`55d22b7`](https://github.com/stdlib-js/stdlib/commit/55d22b7372bc9308ceeee70d202599d8a6897eef) - **docs:** fix description _(by Athan Reines)_
928929
- [`fbcdce5`](https://github.com/stdlib-js/stdlib/commit/fbcdce5ba59c49bfc26be799ef03371e8294813a) - **feat:** add `consensusOrder` to namespace _(by Athan Reines)_

base/consensus-order/lib/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ var DEFAULT_ORDER = defaults.get( 'order' );
5656
* // returns <string>
5757
*/
5858
function resolveString( layout ) {
59-
if ( layout === 0 || layout === 3 ) {
60-
return DEFAULT_ORDER;
61-
}
6259
if ( layout === 1 ) {
6360
return 'row-major';
6461
}
65-
// layout === 2
66-
return 'column-major';
62+
if ( layout === 2 ) {
63+
return 'column-major';
64+
}
65+
// layout === 0 || layout === 3
66+
return DEFAULT_ORDER;
6767
}
6868

6969

base/consensus-order/test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ tape( 'the function returns a storage layout (mixed order)', function test( t )
8686
t.end();
8787
});
8888

89+
tape( 'the function returns a storage layout (mixed order, tie)', function test( t ) {
90+
var sx;
91+
var sy;
92+
var o;
93+
94+
sx = [ 4, -2, 1 ]; // row-major
95+
sy = [ 1, -4, -8 ]; // column-major
96+
97+
o = consensusOrder( [ sx, sy, sx, sy ] );
98+
t.strictEqual( o, DEFAULT_ORDER, 'returns expected value' );
99+
100+
t.end();
101+
});
102+
89103
tape( 'the function returns a storage layout (both orders)', function test( t ) {
90104
var sx;
91105
var sy;

0 commit comments

Comments
 (0)