Last active
August 29, 2015 14:17
some code in librifox that I refactored
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initial code: | |
var xml = xhr.response; | |
var xmlDoc = $.parseXML( xml ); // xml variable is never referenced after this line | |
var newXML = $( xmlDoc ); // redundant form of above line, does nothing | |
var title = newXML.find( "title" ); // misleading, should be plural 'titles' (#find returns all title tags in the document) | |
var enclosure = newXML.find("enclosure"); // never used | |
var currTitle; // unnecessary | |
var currEnclosure; // unnecessary, never used | |
// Refactored into: | |
var xml = $(xhr.response); // consoliated lines 2 - 4 from above | |
var titles = xml.find("title"); // plural variable name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment