Changeset 2740

Show
Ignore:
Timestamp:
01/31/18 00:22:28 (7 months ago)
Author:
jwoithe
Message:

[PATCH 04/13] tools: listirqinfo: avoid creating a temporary list.

A function call can also be eliminated as a result.

From Nicolas Boulenguez

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/tools/listirqinfo.py

    r2739 r2740  
    1919 
    2020LISTIRQINFO_VERSION="0.3" 
    21  
    22 def sortedDictValues(adict): 
    23     items = sorted(adict.items()) 
    24     return [value for key, value in items] 
    2521 
    2622class IRQ: 
     
    134130        print ("Hardware Interrupts:") 
    135131        print ("--------------------") 
    136         for irq in sortedDictValues(self.IRQs): 
     132        for _, irq in sorted (self.IRQs.items ()): 
    137133            print (irq.description ()) 
    138134        print ("") 
    139135        print ("Software Interrupts:") 
    140136        print ("--------------------") 
    141         for irq in sortedDictValues(self.softIRQs): 
     137        for _, irq in sorted (self.softIRQs.items ()): 
    142138            print (irq.description ()) 
    143139