From 3b8199b7182fb60b2c0b192a469693443208c1e4 Mon Sep 17 00:00:00 2001 From: machenmusik Date: Wed, 1 Mar 2017 19:50:15 -0500 Subject: [PATCH] map to forEach, per discussion on PR --- src/components/oculus-touch-controls.js | 6 +++--- src/components/vive-controls.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/oculus-touch-controls.js b/src/components/oculus-touch-controls.js index 8f60a740829..15e2bc692c3 100644 --- a/src/components/oculus-touch-controls.js +++ b/src/components/oculus-touch-controls.js @@ -285,13 +285,13 @@ module.exports.Component = registerComponent('oculus-touch-controls', { // In theory, it might be better to use mapping from axis to control. // In practice, it is not clear whether the additional overhead is worthwhile, // and if we did grouping of axes, we really need de-duplication there. - Object.keys(axesMapping).map(function (key) { + Object.keys(axesMapping).forEach(function (key) { var value = axesMapping[key]; var detail = {}; var changed = !evt.detail.changed; - if (!changed) { value.map(function (axisNumber) { changed |= evt.detail.changed[axisNumber]; }); } + if (!changed) { value.forEach(function (axisNumber) { changed |= evt.detail.changed[axisNumber]; }); } if (changed) { - value.map(function (axisNumber) { detail[self.axisLabels[axisNumber]] = evt.detail.axis[axisNumber]; }); + value.forEach(function (axisNumber) { detail[self.axisLabels[axisNumber]] = evt.detail.axis[axisNumber]; }); self.el.emit(key + 'moved', detail); // If we updated the model based on axis values, that call would go here. } diff --git a/src/components/vive-controls.js b/src/components/vive-controls.js index 3627043c565..88e93e94349 100644 --- a/src/components/vive-controls.js +++ b/src/components/vive-controls.js @@ -199,13 +199,13 @@ module.exports.Component = registerComponent('vive-controls', { // In theory, it might be better to use mapping from axis to control. // In practice, it is not clear whether the additional overhead is worthwhile, // and if we did grouping of axes, we really need de-duplication there. - Object.keys(axesMapping).map(function (key) { + Object.keys(axesMapping).forEach(function (key) { var value = axesMapping[key]; var detail = {}; var changed = !evt.detail.changed; - if (!changed) { value.map(function (axisNumber) { changed |= evt.detail.changed[axisNumber]; }); } + if (!changed) { value.forEach(function (axisNumber) { changed |= evt.detail.changed[axisNumber]; }); } if (changed) { - value.map(function (axisNumber) { detail[self.axisLabels[axisNumber]] = evt.detail.axis[axisNumber]; }); + value.forEach(function (axisNumber) { detail[self.axisLabels[axisNumber]] = evt.detail.axis[axisNumber]; }); self.el.emit(key + 'moved', detail); // If we updated the model based on axis values, that call would go here. }