xmltok: Get rid of string concatenation in a loop.

pull/46/head
Paul Sokolovsky 2015-10-10 13:10:11 +03:00
rodzic e6a6503193
commit 8e19a487c5
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -1,5 +1,3 @@
import string
TEXT = "TEXT"
START_TAG = "START_TAG"
#START_TAG_DONE = "START_TAG_DONE"
@ -46,7 +44,10 @@ class XMLTokenizer:
def getident(self):
self.skip_ws()
ident = ""
while self.curch() in (string.ascii_letters + string.digits):
while True:
c = self.curch()
if not(c.isalpha() or c.isdigit() or c in "_-."):
break
ident += self.getch()
return ident