Mercurial > octave
comparison libgui/src/documentation.cc @ 31803:e25bf4beb488
Replace various iterators with range-based loops (bug #63738)
Replace various iterator-based loops with range-based loops where possible, for brevity.
* libgui/src/documentation-bookmarks.cc: Use range-based loop
* libgui/src/documentation.cc: Use range-based loop
* libgui/src/files-dock-widget.cc: Use range-based loop
* libgui/src/history-dock-widget.cc: Use range-based loop
* libinterp/corefcn/gl-render.cc: Use range-based loop
* libinterp/corefcn/gl2ps-print.cc: Use range-based loop
* libinterp/corefcn/graphics.cc: Use range-based loop
* libinterp/corefcn/sysdep.cc: Use range-based loop
* libinterp/dldfcn/__init_fltk__.cc: Use range-based loop
* libinterp/octave-value/cdef-class.cc: Use range-based loop
* libinterp/octave-value/cdef-package.cc: Use range-based loop
* libgui/src/find-files-model.cc: Add FIXME to note sorted insertion.
* src/octave-svgconvert.cc: Use range-based loop, add FIXME to
note duplicate code, eliminate loop with call to 2-argument constructor.
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Thu, 02 Feb 2023 11:41:24 -0500 |
parents | 21f9b34eb893 |
children | 90621682cc03 |
comparison
equal
deleted
inserted
replaced
31802:142dc0aaa98c | 31803:e25bf4beb488 |
---|---|
512 else | 512 else |
513 { | 513 { |
514 // Remove the quotes we added | 514 // Remove the quotes we added |
515 QString search_string = m_internal_search; | 515 QString search_string = m_internal_search; |
516 | 516 |
517 for (auto r = res.begin (); r != res.end (); r++) | 517 for (const auto& r : res) |
518 { | 518 { |
519 #if defined (HAVE_QHELPSEARCHQUERYWIDGET_SEARCHINPUT) | 519 #if defined (HAVE_QHELPSEARCHQUERYWIDGET_SEARCHINPUT) |
520 QString title = r->title ().toLower (); | 520 QString title = r.title ().toLower (); |
521 QUrl tmpurl = r->url (); | 521 QUrl tmpurl = r.url (); |
522 #else | 522 #else |
523 QString title = r->second.toLower (); | 523 QString title = r.second.toLower (); |
524 QUrl tmpurl = r->first; | 524 QUrl tmpurl = r.first; |
525 #endif | 525 #endif |
526 if (title.contains (search_string.toLower ())) | 526 if (title.contains (search_string.toLower ())) |
527 { | 527 { |
528 if (title.indexOf (search_string.toLower ()) == 0) | 528 if (title.indexOf (search_string.toLower ()) == 0) |
529 { | 529 { |