OSDN Git Service

avoid sorting and one condition in exportscan() function in genmap.py script
authorIvailo Monev <xakepa10@laimg.moc>
Mon, 23 Dec 2019 01:34:24 +0000 (01:34 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Mon, 23 Dec 2019 01:34:24 +0000 (01:34 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
scripts/genmap.py

index 88813e2..df5e045 100755 (executable)
@@ -23,8 +23,8 @@ classesmap = OrderedDict()
 def exportscan(sdir, pattern, component):
     regex = re.compile('(?:class|struct) (?:%s) (\w+)' % pattern)
     for sroot, sdir, lfiles in os.walk(sdir):
-        for sfile in sorted(lfiles):
-            if not sfile.endswith('.h') or sfile.endswith('_p.h'):
+        for sfile in lfiles:
+            if not sfile.endswith(('.h', '_p.h')):
                 continue
             sfull = '%s/%s' % (sroot, sfile)
             with open(sfull, 'rb') as f: