[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    Re: [kopete-devel] [PATCH] Avoiding to test on end()
From:       Michel Hermier <michel.hermier () wanadoo ! fr>
Date:       2005-06-26 8:05:15
Message-ID: 200506261007.49814.michel.hermier () wanadoo ! fr
[Download RAW message or body]

On Sunday 26 June 2005 07:32, Olivier Goffart wrote:
> Le Samedi 25 Juin 2005 19:43, Michel Hermier a écrit :
> > Hi,
> > This patch avoids to loop until reaching end(); while decrementing the
> > iterator. The current code is wrong for 2 reasons:
> > - decrementing to the begin of the list doesn't return the same value as
> > end(); - decrementing to the iterator at the first place, is undefined (see
> > http://doc.trolltech.com/3.3/qmapiterator.html#operator-- )
> > So this provoke an invalid read (potential crash).
> 
> 
> So there are really no way to browse a QMap from the end to the beginning ?
> 
> 

Iterating from the end to the beginning, is not very intuitive, and making iterations \
from the end to the begin introduce unreadable conditions.

Sort of post decrement and test condition ... Not really readable, and maintainable \
for me.

_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic