瀏覽代碼

Change IssuerPubKey constructor to be more functional

Ian Goldberg 2 年之前
父節點
當前提交
81cbdea305
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/lib.rs

+ 2 - 3
src/lib.rs

@@ -95,9 +95,8 @@ impl IssuerPubKey {
         X.push(&privkey.x0tilde * Atable + &privkey.x[0] * Btable);
 
         // The other elements (1 through n) are X[i] = x[i]*A
-        for i in 1..n_plus_one {
-            X.push(&privkey.x[i] * Atable);
-        }
+        X.extend(privkey.x.iter().skip(1).map(|xi| xi * Atable));
+
         IssuerPubKey { X }
     }
 }