File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -452,11 +452,11 @@ void FcitxCandidateWindow::updateClientSideUI(
452452    doLayout (lowerLayout_);
453453    labelLayouts_.clear ();
454454    candidateLayouts_.clear ();
455-     for  (int  i =  0 ; i <  candidates. size (); i++ ) {
456-         labelLayouts_.emplace_back (std::make_unique<MultilineText>( 
457-             theme_->font (), candidates[i] .key ()));
458-         candidateLayouts_.emplace_back (std::make_unique<MultilineText>( 
459-             theme_->font (), candidates[i] .value ()));
455+     for  (const   auto  &candidate :  candidates) {
456+         labelLayouts_.emplace_back (
457+             std::make_unique<MultilineText>( theme_->font (), candidate .key ()));
458+         candidateLayouts_.emplace_back (
459+             std::make_unique<MultilineText>( theme_->font (), candidate .value ()));
460460    }
461461    highlight_ = candidateIndex;
462462    hasPrev_ = hasPrev;
Original file line number Diff line number Diff line change @@ -225,8 +225,8 @@ QFutureWatcher<bool> *QuickPhraseModel::save(const QString &file) {
225225}
226226
227227void  QuickPhraseModel::saveDataToStream (QTextStream &dev) {
228-     for  (int  i =  0 ; i <  list_. size (); i++ ) {
229-         dev << list_[i] .first  << " \t " escapeValue (list_[i] .second ) << " \n " 
228+     for  (const   auto  &item :  list_) {
229+         dev << item .first  << " \t " escapeValue (item .second ) << " \n " 
230230    }
231231}
232232
@@ -263,10 +263,10 @@ bool QuickPhraseModel::saveData(const QString &file,
263263            if  (!tempFile.open (fd, QIODevice::WriteOnly)) {
264264                return  false ;
265265            }
266-             for  (int  i =  0 ; i <  list. size (); i++ ) {
267-                 tempFile.write (list[i] .first .toUtf8 ());
266+             for  (const   auto  &item :  list) {
267+                 tempFile.write (item .first .toUtf8 ());
268268                tempFile.write (" \t " 
269-                 tempFile.write (escapeValue (list[i] .second ).toUtf8 ());
269+                 tempFile.write (escapeValue (item .second ).toUtf8 ());
270270                tempFile.write (" \n " 
271271            }
272272            tempFile.close ();
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments