summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt5
-rw-r--r--repoze/bfg/traversal.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 4cca670d3..a98d135d1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,9 +2,10 @@ Next release
- Speed up ``traversal.model_url`` execution by using a custom url
quoting function instead of Python's ``urllib.quote``, by caching
- URL path segment quoting and encoding results, and by disusing
+ URL path segment quoting and encoding results, by disusing
Python's ``urlparse.urljoin`` in favor of a simple string
- concatenation.
+ concatenation, and by using ``ob.__class__ is unicode`` rather
+ than ``isinstance(ob, unicode)`` in one strategic place.
0.5.5 (12/17/2008)
diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py
index 37f9e0d2e..f4cc25935 100644
--- a/repoze/bfg/traversal.py
+++ b/repoze/bfg/traversal.py
@@ -130,7 +130,7 @@ def _urlsegment(s):
reencode or re-url-quote it """
result = _segment_cache.get(s)
if result is None:
- if isinstance(s, unicode):
+ if s.__class__ is unicode: # isinstance slighly slower (~15%)
result = _url_quote(s.encode('utf-8'))
else:
result = _url_quote(s)