changeset 952:4dd2fedb0a8b

Faster way of unzipping a list.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 27 Sep 2008 10:42:21 +0200
parents bb06a2538928
children e1b809d032df
files viff/shamir.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/viff/shamir.py	Fri Sep 26 21:52:00 2008 +0200
+++ b/viff/shamir.py	Sat Sep 27 10:42:21 2008 +0200
@@ -98,8 +98,7 @@
     Shares is a list of *threshold* + 1 ``(player id, share)`` pairs.
     Recombination is done in the optional point *x_recomb*.
     """
-    xs = [x_i for (x_i, _) in shares]
-    ys = [y_i for (_, y_i) in shares]
+    xs, ys = zip(*shares)
     try:
         key = tuple(xs) + (x_recomb, )
         vector = _recombination_vectors[key]