remove redundant checks in code

This commit is contained in:
Paul Ivanov 2014-02-27 18:13:53 -08:00
parent 14239c01e4
commit eb4e674598

View File

@ -35,20 +35,13 @@ var IPython = (function (IPython) {
SesssionList.prototype.sessions_loaded = function(data){ SesssionList.prototype.sessions_loaded = function(data){
this.sessions = {}; this.sessions = {};
var len = data.length; var len = data.length;
if (len > 0) { var nb_path;
for (var i=0; i<len; i++) { for (var i=0; i<len; i++) {
var nb_path; nb_path = utils.url_path_join(
if (!data[i].notebook.path) { data[i].notebook.path,
nb_path = data[i].notebook.name; data[i].notebook.name
} );
else { this.sessions[nb_path] = data[i].id;
nb_path = utils.url_path_join(
data[i].notebook.path,
data[i].notebook.name
);
}
this.sessions[nb_path] = data[i].id;
}
} }
$([IPython.events]).trigger('sessions_loaded.Dashboard', this.sessions); $([IPython.events]).trigger('sessions_loaded.Dashboard', this.sessions);
}; };