Skip to content

Commit

Permalink
Remove redundant reassignments
Browse files Browse the repository at this point in the history
PR-URL: #425
  • Loading branch information
belochub authored and nechaido committed May 2, 2019
1 parent e2db419 commit d619834
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/array.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

const common = require('@metarhia/common');

// Asynchronous map (iterate parallel)
// items - <Array>, incoming
// fn - <Function>, to be executed for each value in the array
Expand All @@ -13,7 +11,6 @@ const common = require('@metarhia/common');
// err - <Error> | <null>
// result - <Array>
const map = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;
if (!len) {
done(null, []);
Expand Down Expand Up @@ -114,7 +111,6 @@ const asyncMap = (items, fn, options = {}, done) => {
// err - <Error> | <null>
// result - <Array>
const filter = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;

if (!len) {
Expand Down Expand Up @@ -172,7 +168,6 @@ const REDUCE_EMPTY_ARR =
// initial - <any>, optional value to be used as first
// argument in first iteration
const reduce = (items, fn, done, initial) => {
done = done || common.emptyness;
const len = items.length;
const hasInitial = typeof initial !== 'undefined';

Expand Down Expand Up @@ -230,7 +225,6 @@ const REDUCE_RIGHT_EMPTY_ARR =
// initial - <any>, optional value to be used as first
// argument in first iteration
const reduceRight = (items, fn, done, initial) => {
done = done || common.emptyness;
const len = items.length;
const hasInitial = typeof initial !== 'undefined';

Expand Down Expand Up @@ -277,7 +271,6 @@ const reduceRight = (items, fn, done, initial) => {
// err - <Error> | <null>
// items - <Array>
const each = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;
if (len === 0) {
done(null, items);
Expand Down Expand Up @@ -312,7 +305,6 @@ const each = (items, fn, done) => {
// err - <Error> | <null>
// items - <Array>
const series = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;
let i = -1;

Expand Down Expand Up @@ -344,7 +336,6 @@ const series = (items, fn, done) => {
// err - <Error> | <null>
// result - <any>
const find = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;
if (len === 0) {
done();
Expand Down Expand Up @@ -384,7 +375,6 @@ const find = (items, fn, done) => {
// err - <Error> | <null>
// result - <boolean>
const every = (items, fn, done) => {
done = done || common.emptyness;
if (items.length === 0) {
done(null, true);
return;
Expand Down Expand Up @@ -417,7 +407,6 @@ const every = (items, fn, done) => {
// err - <Error> | <null>
// result - <boolean>
const some = (items, fn, done) => {
done = done || common.emptyness;
const len = items.length;
let i = 0;

Expand Down

0 comments on commit d619834

Please sign in to comment.