Closed KurtE closed 1 month ago
Any reason this is using FS* as the parameter rather than FS& ? The latter would seem to be safer, as there's then no need for a NULL pointer check (which you don't make...)
Could go either way, my first version did use references. My first usage was with array with pointers, so had to dereference them passed in. Actually both classes do test for null pointer Sent from my iPadOn Dec 31, 2022, at 2:41 PM, Jonathan Oakley @.**> wrote: Any reason this is using FS as the parameter rather than FS& ? The latter would seem to be safer, as there's then no need for a NULL pointer check (which you don't make...)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Could go either way, my first version did use references. My first usage was with array with pointers, so had to dereference them passed in. Actually both classes do test for null pointer Sent from my iPad
Mea culpa, I didn't inspect your code properly - indeed you do have a check for NULL pointers. As an "old school C programmer" I'm not sure if there's a "preferred C++ way" ... but moving it from a run-time to a compile-time check feels better to me, as you won't get unexpected silence from a NULL pointer, or weird crashes if you somehow manage to pass an invalid pointer (a skill I seem to have mastered...).
Closing out detritus
@PaulStoffregen @mjs513 @h4yn0nnym0u5e
This is an alternate implementation of
419
As mentioned in the forum thread: https://forum.pjrc.com/threads/71716-recording-playing-back-audio-on-multiple-SD-cards
It simply adds optional parameter at the end of the play method for the FS which defaults to SD
The other PR, makes a copy of the play method and adds the FS as the first parameter.
Either way works for me.