From 24ea74dc410a1f9bc3f58792a46eec16ddbc7a3a Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 17 Aug 2014 22:10:16 -0400 Subject: [PATCH] lol O(log(n)) to O(1) and away --- src/user/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user/notifications.js b/src/user/notifications.js index 7f4a833350..b6e82e6d23 100644 --- a/src/user/notifications.js +++ b/src/user/notifications.js @@ -226,7 +226,7 @@ var async = require('async'), }; UserNotifications.getUnreadCount = function(uid, callback) { - db.sortedSetCount('uid:' + uid + ':notifications:unread', -Infinity, Infinity, callback); + db.sortedSetCard('uid:' + uid + ':notifications:unread', callback); }; UserNotifications.getUnreadByField = function(uid, field, value, callback) {