You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
making some parameters const, plus minor improvements
* changed some parameters to "pointer to const", so compiler can better optimize code size and performance - because data behind a const pointer will never be modified by the called function.
* made setPixelColor `const`
* fixed a few potentially uninitialized local vars (the may have random values if not initialized)
* avoid shadowing "state" in handleSerial()
* plus a few very minor improvements
Copy file name to clipboardExpand all lines: wled00/FX.h
+7-7
Original file line number
Diff line number
Diff line change
@@ -460,7 +460,7 @@ typedef struct Segment {
460
460
{}
461
461
} *_t;
462
462
463
-
[[gnu::hot]] void_setPixelColorXY_raw(int& x, int& y, uint32_t& col) const; // set pixel without mapping (internal use only)
463
+
[[gnu::hot]] void_setPixelColorXY_raw(constint& x,constint& y, uint32_t& col) const; // set pixel without mapping (internal use only)
464
464
465
465
public:
466
466
@@ -588,7 +588,7 @@ typedef struct Segment {
588
588
inlinevoidhandleTransition() { updateTransitionProgress(); if (progress() == 0xFFFFU) stopTransition(); }
589
589
#ifndef WLED_DISABLE_MODE_BLEND
590
590
voidswapSegenv(tmpsegd_t &tmpSegD); // copies segment data into specifed buffer, if buffer is not a transition buffer, segment data is overwritten from transition buffer
591
-
voidrestoreSegenv(tmpsegd_t &tmpSegD); // restores segment data from buffer, if buffer is not transition buffer, changed values are copied to transition buffer
591
+
voidrestoreSegenv(consttmpsegd_t &tmpSegD); // restores segment data from buffer, if buffer is not transition buffer, changed values are copied to transition buffer
592
592
#endif
593
593
[[gnu::hot]] voidupdateTransitionProgress(); // set current progression of transition
0 commit comments