From 0e241456e44ef6c7d78035855c2d9ba594ef99a5 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 22 Jul 2014 12:02:15 -0400 Subject: [PATCH] less code --- src/sitemap.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/sitemap.js b/src/sitemap.js index 6f75486ba2..7bf9445596 100644 --- a/src/sitemap.js +++ b/src/sitemap.js @@ -75,15 +75,9 @@ var path = require('path'), }); }, render: function(callback) { - var returnSitemap = function() { - sitemap.obj.toXML(function(xml) { - callback(xml); - }); - }; - if (sitemap.obj !== undefined && sitemap.obj.cache.length) { console.log('using sitemap from cache!'); - returnSitemap(); + sitemap.obj.toXML(callback); } else { console.log('generating new sitemap!', sitemap.obj); async.parallel([sitemap.getStaticUrls, sitemap.getDynamicUrls], function(err, urls) { @@ -94,7 +88,7 @@ var path = require('path'), urls: urls }); - returnSitemap(); + sitemap.obj.toXML(callback); }); } }