Browse Source

🎨 Use LEDColor default C-CTOR

Scott Lahteine 2 years ago
parent
commit
cbf8622670
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      Marlin/src/feature/leds/leds.h

+ 2
- 5
Marlin/src/feature/leds/leds.h View File

@@ -54,6 +54,8 @@ typedef struct LEDColor {
54 54
     OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS))
55 55
   {}
56 56
 
57
+  LEDColor(const LEDColor&) = default;
58
+
57 59
   LEDColor(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS))
58 60
     : r(r), g(g), b(b) OPTARG(HAS_WHITE_LED, w(w)) OPTARG(NEOPIXEL_LED, i(i)) {}
59 61
 
@@ -68,11 +70,6 @@ typedef struct LEDColor {
68 70
     return *this;
69 71
   }
70 72
 
71
-  LEDColor& operator=(const LEDColor &right) {
72
-    if (this != &right) memcpy(this, &right, sizeof(LEDColor));
73
-    return *this;
74
-  }
75
-
76 73
   bool operator==(const LEDColor &right) {
77 74
     if (this == &right) return true;
78 75
     return 0 == memcmp(this, &right, sizeof(LEDColor));

Loading…
Cancel
Save