Change in vdsm[master]: virt: Check the full range of replaceble chars in filtering
nsoffer at redhat.com
nsoffer at redhat.com
Fri Jan 16 16:52:10 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: virt: Check the full range of replaceble chars in filtering
......................................................................
Patch Set 3:
(2 comments)
http://gerrit.ovirt.org/#/c/36952/3/vdsm/virt/guestagent.py
File vdsm/virt/guestagent.py:
Line 69
Line 70
Line 71
Line 72
Line 73
Can be removed now
Line 43: union(set(range(0xE, 0x1F + 1))). \
Line 44: union(set(range(0x7F, 0x84 + 1))). \
Line 45: union(set(range(0x86, 0x9F + 1))). \
Line 46: union(set((0xFFFE, 0xFFFF)))
Line 47: _RESTRICTED_CHARS = frozenset(map(unichr, _RESTRICTED_CHARS))
This creates a lot of lists and sets, then create a frozenset and drop all the lists and sets. We can do better:
_RESTRICTED_CHARS = frozenset(map(unichr,
range(8 + 1) +
range(0xB, 0xC + 1) +
range(0xE, 0x1F + 1) +
range(0x7F, 0x84 + 1) +
range(0x86, 0x9F + 1) +
[0xFFFE, 0xFFFF]
))
This create only the lists, which are cheaper to create and is more clear.
Line 48:
Line 49:
Line 50: def _filterXmlChars(u):
Line 51: """
--
To view, visit http://gerrit.ovirt.org/36952
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ida62ef962e2e35a7b110c1e66b3a30ec3700f85d
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list