Author: aschnell Date: Thu Apr 16 15:35:34 2009 New Revision: 56816 URL: http://svn.opensuse.org/viewcvs/yast?rev=56816&view=rev Log: - use appropriate stl function Modified: trunk/storage/libstorage/src/Dasd.cc trunk/storage/libstorage/src/Disk.cc trunk/storage/libstorage/src/DmPartCo.cc trunk/storage/libstorage/src/StorageTypes.h Modified: trunk/storage/libstorage/src/Dasd.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Dasd.cc?rev=56816&r1=56815&r2=56816&view=diff ============================================================================== --- trunk/storage/libstorage/src/Dasd.cc (original) +++ trunk/storage/libstorage/src/Dasd.cc Thu Apr 16 15:35:34 2009 @@ -435,14 +435,7 @@ Disk::getCommitActions( l ); if( init_disk ) { - list<commitAction>::iterator i = l.begin(); - while( i!=l.end() ) - { - if( i->stage==DECREASE ) - i=l.erase( i ); - else - ++i; - } + l.remove_if(stage_equal_to(DECREASE)); l.push_front(commitAction(DECREASE, staticType(), dasdfmtText(false), this, true)); } } Modified: trunk/storage/libstorage/src/Disk.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Disk.cc?rev=56816&r1=56815&r2=56816&view=diff ============================================================================== --- trunk/storage/libstorage/src/Disk.cc (original) +++ trunk/storage/libstorage/src/Disk.cc Thu Apr 16 15:35:34 2009 @@ -1813,14 +1813,7 @@ Container::getCommitActions( l ); if( deleted() ) { - list<commitAction>::iterator i = l.begin(); - while( i!=l.end() ) - { - if( i->stage==DECREASE ) - i=l.erase( i ); - else - ++i; - } + l.remove_if(stage_equal_to(DECREASE)); l.push_front(commitAction(DECREASE, staticType(), setDiskLabelText(false), this, true)); } } Modified: trunk/storage/libstorage/src/DmPartCo.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/DmPartCo.cc?rev=56816&r1=56815&r2=56816&view=diff ============================================================================== --- trunk/storage/libstorage/src/DmPartCo.cc (original) +++ trunk/storage/libstorage/src/DmPartCo.cc Thu Apr 16 15:35:34 2009 @@ -725,14 +725,7 @@ y2mil( "l:" << l ); if( deleted() || del_ptable ) { - list<commitAction>::iterator i = l.begin(); - while( i!=l.end() ) - { - if( i->stage==DECREASE ) - i=l.erase( i ); - else - ++i; - } + l.remove_if(stage_equal_to(DECREASE)); string txt = deleted() ? removeText(false) : setDiskLabelText(false); l.push_front(commitAction(DECREASE, staticType(), txt, this, true)); } Modified: trunk/storage/libstorage/src/StorageTypes.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageTypes.h?rev=56816&r1=56815&r2=56816&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageTypes.h (original) +++ trunk/storage/libstorage/src/StorageTypes.h Thu Apr 16 15:35:34 2009 @@ -125,6 +125,14 @@ }; + struct stage_equal_to + { + stage_equal_to(CommitStage t) : val(t) {} + bool operator()(const commitAction& t) const { return t.stage == val; } + const CommitStage val; + }; + + class usedBy { // TODO: save device instead of name? -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org