Ticket #4828: libs_libmyth_uitypes.cpp-why-assign-when-unnecessary.patch

File libs_libmyth_uitypes.cpp-why-assign-when-unnecessary.patch, 972 bytes (added by Erik Hovland <erik@…>, 18 years ago)

removes assignment from at() and first() return values

  • libs/libmyth/uitypes.cpp

    When calling ::at() or ::first() of QPtrList, the caller is attempting to change
    
    From: Erik Hovland <erik@hovland.org>
    
    the current node in the pointer list. The calls do return a node. But it is unused. So
    there really is no need to cause the processor to make an assignment.
    ---
    
     libs/libmyth/uitypes.cpp |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/libs/libmyth/uitypes.cpp b/libs/libmyth/uitypes.cpp
    index 89f289f..3365429 100644
    a b void UIManagedTreeListType::Draw(QPainter *p, int drawlayer, int context)  
    34893489            menuItems.setAutoDelete(true);
    34903490
    34913491            if (pos > (int)lcddev->getLCDHeight())
    3492                 lnode = nodes->at(pos - lcddev->getLCDHeight());
     3492                nodes->at(pos - lcddev->getLCDHeight());
    34933493            else
    3494                 lnode = nodes->first();
     3494                nodes->first();
    34953495
    34963496            uint count = 0;
    34973497