From 0d1413021ac278d429524fa627b6da4ba0ff32d5 Mon Sep 17 00:00:00 2001
From: Alice BRENON <alice.brenon@ens-lyon.fr>
Date: Thu, 17 Mar 2022 09:49:46 +0100
Subject: [PATCH] Move constant instruction out of a nested loop

---
 scripts/confusionMatrices.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/confusionMatrices.py b/scripts/confusionMatrices.py
index ff0c990..a850740 100644
--- a/scripts/confusionMatrices.py
+++ b/scripts/confusionMatrices.py
@@ -28,9 +28,9 @@ def __syntax(this):
     sys.exit(1)
 
 def __compute(sourcePath, ns, ranksToTry, metricNames, outputDir):
+    source = data.load(sourcePath)
     for n in ns:
         for ranks in ranksToTry:
-            source = data.load(sourcePath)
             vectorizer = topNGrams(source, n, ranks)
             for name in metricNames:
                 imagePath = preparePath(outputDir, source, n, ranks, name)
-- 
GitLab