[Git][NTPsec/ntpsec][master] Removed some single use variables from stringfiltcooker

Ian Bruene gitlab at mg.gitlab.com
Thu Sep 28 03:19:27 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
df9d118f by Ian Bruene at 2017-09-27T22:18:21-05:00
Removed some single use variables from stringfiltcooker

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -158,15 +158,15 @@ def stringfiltcooker(data):
         if count > highestcount:
             mostcommon = key
             highestcount = count
-    mspos = UNITS_SEC.index(UNIT_MS)
-    newunit = UNITS_SEC[mostcommon + mspos]
+    newunit = UNITS_SEC[mostcommon + UNITS_SEC.index(UNIT_MS)]
     # Shift all values to the new unit
     cooked = []
     for part in parts:
         part = rescalestring(part, mostcommon)
         fitted = fitinfield(part, 7)
         cooked.append(fitted)
-    rendered = " ".join(cooked) + " " + newunit
+    rendered = " ".join(cooked) + " " + UNITS_SEC[mostcommon + \
+                                                  UNITS_SEC.index(UNIT_MS)]
     return rendered
 
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/df9d118f51f4d553d9757a0de49678418e0971d1

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/df9d118f51f4d553d9757a0de49678418e0971d1
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170928/a232df8c/attachment.html>


More information about the vc mailing list