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){
this.sessions = {};
var len = data.length;
if (len > 0) {
for (var i=0; i<len; i++) {
var nb_path;
if (!data[i].notebook.path) {
nb_path = data[i].notebook.name;
}
else {
nb_path = utils.url_path_join(
data[i].notebook.path,
data[i].notebook.name
);
}
this.sessions[nb_path] = data[i].id;
}
var nb_path;
for (var i=0; i<len; i++) {
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);
};