Skip to content

Commit

Permalink
simplify default case loop in pipe function
Browse files Browse the repository at this point in the history
  • Loading branch information
pbadenski authored and gcanti committed Sep 21, 2021
1 parent eb9bf65 commit 295ea40
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/function.ts
Expand Up @@ -673,13 +673,9 @@ export function pipe(
case 9:
return hi!(gh!(fg!(ef!(de!(cd!(bc!(ab!(a))))))))
default:
let ret
for (let i = 0; i < arguments.length; i++) {
if (i === 0) {
ret = arguments[0]
} else {
ret = arguments[i](ret)
}
let ret = arguments[0]
for (let i = 1; i < arguments.length; i++) {
ret = arguments[i](ret)
}
return ret
}
Expand Down

0 comments on commit 295ea40

Please sign in to comment.