Use range-based for loops in dialup and mediaplayer samples (PR #26640)

8 views
Skip to first unread message

Nong Thi Quynh Anh

unread,
Jun 27, 2026, 9:22:54 AM (yesterday) Jun 27
to wx-...@googlegroups.com, Subscribed

This PR modernizes loops in the samples/ directory by replacing index‑based iteration with C++11 range‑based for loops where appropriate.

  • These changes improve readability and reduce the risk of indexing errors.
  • Only loops that do not rely on the index for logic were modified.
  • No behavior changes are introduced.

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26640

Commit Summary

  • b063caa Use range-based for loops in dialup and mediaplayer samples

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26640@github.com>

Nong Thi Quynh Anh

unread,
Jun 27, 2026, 10:54:08 AM (24 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed
anhnong90 left a comment (wxWidgets/wxWidgets#26640)

Hi, just a small note:
The Ubuntu 18.04 GTK2/GTK3 jobs seem to fail due to the CI environment itself. The logs show a PPA/GPG issue during setup, long before the build reaches any of the sample code. All other platforms passed fine. This PR only updates simple loops in the samples and doesn’t change behavior.
Thanks a lot for taking a look!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26640/c4818535312@github.com>

VZ

unread,
Jun 27, 2026, 12:35:10 PM (22 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26640)

Thanks, this can be merged but are these the only example of for loops that could be modernized? I'm a bit surprised by this... Have you done this manually or did you try running clang-tidy which I think has a check to do this automatically?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26640/c4819174501@github.com>

Nong Thi Quynh Anh

unread,
Jun 27, 2026, 1:13:36 PM (21 hours ago) Jun 27
to wx-...@googlegroups.com, Subscribed
anhnong90 left a comment (wxWidgets/wxWidgets#26640)

Thanks for the feedback!

I found these loops while working through the samples/, and decided to modernize them to make the sample code a bit clearer for newer learners. I searched the samples/ folder using some useful commands like:

git grep -n "for (size_t" samples/
git grep -n "for.*size_t.*<.*Count"

and manually checked each match to ensure it was safe to convert. These were the only cases that met the criteria.

I haven’t used clang‑tidy for this pass, but I’m happy to do so — and I’m also willing to continue in this direction in more areas if that would be helpful.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26640/c4819595929@github.com>

Reply all
Reply to author
Forward
0 new messages