浏览代码

no yoda

usually, '10 === finished' would be considered yoda
but in this case, with this naming of variables
it makes a lot more sense this way
jomo 10 年之前
父节点
当前提交
bb4de15ff2
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      test/test.js

+ 1 - 2
test/test.js

@@ -311,8 +311,7 @@ describe("Crafatar", function() {
       var finished = 0;
       function partDone() {
         finished++;
-        if (finished === requests) {
-          // all requests have finished
+        if (requests === finished) {
           done();
         }
       }