General cleanup of single-line statements

This commit is contained in:
Andrew Stewart 2014-06-09 14:02:06 -07:00
parent dd553a55f2
commit 3672a1b712
1 changed files with 21 additions and 6 deletions

View File

@ -147,7 +147,10 @@ Robot.prototype.toJSON = function() {
// Returns initialized connections
Robot.prototype.initConnections = function(connections) {
Logger.info("Initializing connections.");
if (connections == null) { return; }
if (connections == null) {
return;
}
connections = [].concat(connections);
@ -168,7 +171,10 @@ Robot.prototype.initConnections = function(connections) {
// Returns initialized devices
Robot.prototype.initDevices = function(devices) {
Logger.info("Initializing devices.");
if (devices == null) { return; }
if (devices == null) {
return;
}
devices = [].concat(devices);
@ -260,8 +266,13 @@ Robot.prototype.startDevices = function(callback) {
//
// Returns nothing
Robot.prototype.halt = function() {
for (var d in this.devices) { this.devices[d].halt(); }
for (var c in this.connections) { this.connections[c].halt(); }
for (var d in this.devices) {
this.devices[d].halt();
}
for (var c in this.connections) {
this.connections[c].halt();
}
};
// Public: Initialize an adaptor and adds it to @robot.adaptors
@ -271,7 +282,9 @@ Robot.prototype.halt = function() {
//
// Returns the adaptor
Robot.prototype.initAdaptor = function(adaptorName, connection, opts) {
if (opts == null) { opts = {}; }
if (opts == null) {
opts = {};
}
var adaptor = this.requireAdaptor(adaptorName, opts).adaptor({
name: adaptorName,
@ -333,7 +346,9 @@ Robot.prototype.registerAdaptor = function(moduleName, adaptorName) {
//
// Returns the new driver
Robot.prototype.initDriver = function(driverName, device, opts) {
if (opts == null) { opts = {}; }
if (opts == null) {
opts = {};
}
var driver = this.requireDriver(driverName).driver({
name: driverName,