SolderedElectronics / Inkplate-Arduino-library

Inkplate family Arduino library. The easiest way to add e-paper to your project.
https://inkplate.readthedocs.io/en/latest/arduino.html
GNU Lesser General Public License v3.0
249 stars 78 forks source link

Use foreach bzw. auto loop for itterating over lists #217

Closed tost11 closed 1 year ago

tost11 commented 1 year ago
for(auto ev:eventList){
    if (ev->isActive()) {
        return ev;
    }
}

instead of

for (int i = 0; i < eventList.size(); i++) { if (eventList[i]->isActive()) { return eventList[i]; } }

rsoric commented 1 year ago

Hi @tost11

Same as the smart pointers comment, internally, we prefer the classic way of writing for loops so we'll stick to doing it that way. Thanks for your input though! I hope you're enjoying making something cool with Inkplate.

-Rob