]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Optimize slice assignments.
authorRaymond Hettinger <python@rcn.com>
Tue, 9 Mar 2004 08:04:33 +0000 (08:04 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 9 Mar 2004 08:04:33 +0000 (08:04 +0000)
commitf889e10c198864ec5e14bb5f93d63f5b1ce21cc8
treee2bd49a2c2f7eeeecafe2072a00eb658687b33e5
parent9168c70438a4f95099dc77377ceb11017bd1ff36
Optimize slice assignments.

* Replace sprintf message with a constant message string -- this error
  message ran on every invocation except straight deletions but it was
  only needed when the rhs was not iterable.  The message was also
  out-of-date and did not reflect that iterable arguments were allowed.

* For inner loops that do not make ref count adjustments, use memmove()
  for fast copying and better readability.

* For inner loops that do make ref count adjustments, speed them up by
  factoring out the constant structure reference and using vitem[] instead.
Objects/listobject.c