From: Vinay Sajip Date: Tue, 31 Oct 2006 17:32:37 +0000 (+0000) Subject: Change to improve speed of _fixupChildren X-Git-Tag: v2.6a1~2471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef7f3bf3b306cf8702496cb8ac2c7afdcf1b2fdb;p=thirdparty%2FPython%2Fcpython.git Change to improve speed of _fixupChildren --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 71efbd67fb8d..c72730843e46 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -910,9 +910,12 @@ class Manager: Ensure that children of the placeholder ph are connected to the specified logger. """ - #for c in ph.loggers: + name = alogger.name + namelen = len(name) for c in ph.loggerMap.keys(): - if string.find(c.parent.name, alogger.name) <> 0: + #The if means ... if not c.parent.name.startswith(nm) + #if string.find(c.parent.name, nm) <> 0: + if c.parent.name[:namelen] != name: alogger.parent = c.parent c.parent = alogger