[Pkg-mozext-commits] [sage-extension] 44/54: Simplifying compare function
David Prévot
taffit at moszumanska.debian.org
Fri May 1 03:10:40 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag sage_1_3
in repository sage-extension.
commit 7165220feadd4ba0e60a0347530104e46c4b7994
Author: Erik Arvidsson <erik.arvidsson at gmail.com>
Date: Sun Oct 10 09:35:36 2004 +0000
Simplifying compare function
---
src/sage/content/feedlib.js | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index ec32ba6..880d9f8 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -31,7 +31,7 @@ function Feed(feedXML) {
Feed.prototype.parseRSS = function() {
var feedXML = this.feedXML;
-
+
const nsIURIFixup = Components.interfaces.nsIURIFixup;
const URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"].getService(nsIURIFixup);
@@ -300,18 +300,9 @@ Feed.prototype.getItems = function(sort) {
items.push(this.items[c]);
}
function chronoSort(a, b) {
- var a_ts, b_ts;
- if(a.hasPubDate()) {
- a_ts = a.getPubDate().getTime();
- } else {
- a_ts = 0;
- }
- if(b.hasPubDate()) {
- b_ts = b.getPubDate().getTime();
- } else {
- b_ts = 0;
- }
- return (a_ts < b_ts ? 1 : (b_ts < a_ts ? -1 : 0));
+ var a_ts = a.hasPubDate() ? a.getPubDate() : 0;
+ var b_ts = b.hasPubDate() ? b.getPubDate() : 0;
+ return b_ts - a_ts;
}
items.sort(chronoSort);
items_array = items;
@@ -500,4 +491,4 @@ function entityDecode(aStr) {
return toStr.toString();
}
return aStr;
-}
\ No newline at end of file
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git
More information about the Pkg-mozext-commits
mailing list