Browse Source

Merge pull request #5680 from thinkyhead/rc_configs_puhlease

code_value_float tweak
Scott Lahteine 7 years ago
parent
commit
7743849608
1 changed files with 4 additions and 8 deletions
  1. 4
    8
      Marlin/Marlin_main.cpp

+ 4
- 8
Marlin/Marlin_main.cpp View File

@@ -1189,15 +1189,11 @@ inline bool code_has_value() {
1189 1189
 }
1190 1190
 
1191 1191
 inline float code_value_float() {
1192
-  float ret;
1193 1192
   char* e = strchr(seen_pointer, 'E');
1194
-  if (e) {
1195
-    *e = 0;
1196
-    ret = strtod(seen_pointer + 1, NULL);
1197
-    *e = 'E';
1198
-  }
1199
-  else
1200
-    ret = strtod(seen_pointer + 1, NULL);
1193
+  if (!e) return strtod(seen_pointer + 1, NULL);
1194
+  *e = 0;
1195
+  float ret = strtod(seen_pointer + 1, NULL);
1196
+  *e = 'E';
1201 1197
   return ret;
1202 1198
 }
1203 1199
 

Loading…
Cancel
Save