Skip to content

Commit

Permalink
there was no need for setting the root element multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 committed Aug 26, 2011
1 parent ed31c95 commit 0a07e99
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/nodepie.js
Expand Up @@ -212,29 +212,27 @@ NodePie.prototype._checkType = function(){

type = key.trim().toLowerCase();

this.rootElement = elem;

if(type === "feed"){
this.feedType = "atom";
this.rootElement = elem;
this.channelElement = elem || {};
this.itemsElement = elem.entry || [];
break;
}
else if(type === "rss"){
this.feedType = "rss";
this.rootElement = elem;
this.channelElement = elem.channel || {};
this.itemsElement = this.channelElement.item || [];
break;
}
else if(type === "rdf" || type.substr(-4) === ":rdf"){
this.feedType = "rdf";
this.rootElement = elem;
this.channelElement = elem.channel || {};
this.itemsElement = elem.item || [];
break;
}
else{
this.rootElement = null;
}
}

if(!this.rootElement){
Expand Down

0 comments on commit 0a07e99

Please sign in to comment.