Skip to content

Commit 4b9fdde

Browse files
authored
Merge pull request #94 from purescript/array-semigroup-optimisation
Array semigroup optimisation
2 parents 178e71d + 689e736 commit 4b9fdde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Data/Semigroup.js

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ exports.concatString = function (s1) {
88

99
exports.concatArray = function (xs) {
1010
return function (ys) {
11+
if (xs.length === 0) return ys;
12+
if (ys.length === 0) return xs;
1113
return xs.concat(ys);
1214
};
1315
};

0 commit comments

Comments
 (0)