[Git][NTPsec/ntpsec][master] Deleted 1 commit: Skip a join(splt()) and profit.

Gary E. Miller gitlab at mg.gitlab.com
Sat Aug 20 03:59:40 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.


Deleted commits:
ae182ac8 by Gary E. Miller at 2016-08-19T20:58:55-07:00
Skip a join(splt()) and profit.

- - - - -


1 changed file:

- pylib/statfiles.py


Changes:

=====================================
pylib/statfiles.py
=====================================
--- a/pylib/statfiles.py
+++ b/pylib/statfiles.py
@@ -17,7 +17,7 @@ class NTPStats:
         "convert timestamp (MJD & seconds past midnight) to Unix time"
         "Replace MJD+second with Unix time."
         try:
-            split = line.split()
+            split = line.split(None, 2)
             mjd = int(split[0])
             second = float(split[1])
         except:
@@ -27,7 +27,7 @@ class NTPStats:
         time = 86400*mjd + second - 3506716800; # warning: 32 bit overflows
         if time < starttime or time > endtime:
             return None
-        return str(time) + " " + " ".join(split[2:])
+        return str(time) + " " + split[2]
     @staticmethod
     def timestamp(line):
         "get Unix time from converted line."
@@ -56,8 +56,8 @@ class NTPStats:
                 # Morph first field into Unix time with fractional seconds
                 lines = [ NTPStats.unixize(line,starttime, endtime) \
                      for line in lines if line != None]
+                lines = [ line for line in lines if line != None]
 
-            lines = [ line for line in lines if line != None]
             # Sort by datestamp
             lines.sort(key=lambda line: line.split()[0])
             setattr(self, stem, lines)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ae182ac8513ed449acb73a7a59aa76596ac6fa81
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160820/25c0072d/attachment.html>


More information about the vc mailing list