Author: Justin Peel <notmuchtot...@gmail.com> Branch: Changeset: r53154:c3c5061a39af Date: 2012-03-03 14:11 -0700 http://bitbucket.org/pypy/pypy/changeset/c3c5061a39af/
Log: speed up unpickling of datetime.time objects diff --git a/lib_pypy/datetime.py b/lib_pypy/datetime.py --- a/lib_pypy/datetime.py +++ b/lib_pypy/datetime.py @@ -1421,9 +1421,10 @@ def __setstate(self, string, tzinfo): if len(string) != 6 or ord(string[0]) >= 24: raise TypeError("an integer is required") - self._hour, self._minute, self._second, us1, us2, us3 = \ - map(ord, string) - self._microsecond = (((us1 << 8) | us2) << 8) | us3 + self._hour, self._minute, self._second = ord(string[0]), \ + ord(string[1]), ord(string[2]) + self._microsecond = (((ord(string[3]) << 8) | \ + ord(string[4])) << 8) | ord(string[5]) self._tzinfo = tzinfo def __reduce__(self): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit