code robustness improvements plus minor speedup
* make XY() and _setPixelColorXY_raw() const (minor speedup) * segment is a struct not a class: friend class Segment --> friend struct Segment * fix missing braces around two macros * use non-throwing "new" where possible * improve robustness of transition code
This commit is contained in:
@@ -61,7 +61,7 @@ int16_t loadPlaylist(JsonObject playlistObj, byte presetId) {
|
||||
if (playlistLen == 0) return -1;
|
||||
if (playlistLen > 100) playlistLen = 100;
|
||||
|
||||
playlistEntries = new PlaylistEntry[playlistLen];
|
||||
playlistEntries = new(std::nothrow) PlaylistEntry[playlistLen];
|
||||
if (playlistEntries == nullptr) return -1;
|
||||
|
||||
byte it = 0;
|
||||
|
||||
Reference in New Issue
Block a user