Revision: 6279
Author: nogu.dev
Date: Wed Mar 24 15:04:57 2010
Log: * qt4/immodule/candidatewindow.cpp
  - (CandidateWindow::~CandidateWindow,
     CandidateWindow::clearCandidates): Simplify. Maybe optimize.
http://code.google.com/p/uim/source/detail?r=6279

Modified:
 /trunk/qt4/immodule/candidatewindow.cpp

=======================================
--- /trunk/qt4/immodule/candidatewindow.cpp     Wed Mar 24 15:04:35 2010
+++ /trunk/qt4/immodule/candidatewindow.cpp     Wed Mar 24 15:04:57 2010
@@ -101,13 +101,9 @@

 CandidateWindow::~CandidateWindow()
 {
-    if ( !stores.isEmpty() )
-    {
-        // clear stored candidate data
-        for ( int i = 0; i < stores.size(); i++ )
-            uim_candidate_free( stores[ i ] );
-        stores.clear();
-    }
+    // clear stored candidate data
+    while ( !stores.isEmpty() )
+        uim_candidate_free( stores.takeFirst() );
 }

 void CandidateWindow::popup()
@@ -148,12 +144,11 @@
     nrCandidates = 0;

     // clear stored candidate data
-    for ( int i = 0; i < stores.size(); i++ )
-    {
-        if ( stores[ i ] )
-            uim_candidate_free( stores[ i ] );
-    }
-    stores.clear();
+    while ( !stores.isEmpty() ) {
+        uim_candidate cand = stores.takeFirst();
+        if ( cand )
+            uim_candidate_free( cand );
+    }
 }


To unsubscribe from this group, send email to uim-commit+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.

Reply via email to