Commit ed964ddda13691222271c10b187256febbb08003

Authored by Geoffrey PREUD'HOMME
1 parent 74d33075

Supression de isEmpty

Showing 1 changed file with 1 additions and 8 deletions   Show diff stats
app/services/PolyUserServ.js
... ... @@ -8,13 +8,6 @@ var cache = new NodeCache();
8 8  
9 9 var PolyUserServ = {};
10 10  
11   -function isEmpty(obj) {
12   - for (var i in obj) {
13   - return false;
14   - }
15   - return true;
16   -}
17   -
18 11 PolyUserServ.readPasswd = function (login, cb) {
19 12 passwdF = 'config/passwd';
20 13 fs.exists(passwdF, function (exists) {
... ... @@ -132,7 +125,7 @@ PolyUserServ.get = function (login, cb) {
132 125 if (err) {
133 126 cb(err);
134 127 } else {
135   - if (isEmpty(data)) {
  128 + if (data[login] === undefined) {
136 129 PolyUserServ.add(login, cb);
137 130 } else {
138 131 cb(null, data[login]);
... ...