mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-07 07:16:36 +02:00
refactor
This commit is contained in:
@@ -8,11 +8,7 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
function _str_to_int(t) =
|
function _str_to_int(t) = ord(t) - 48;
|
||||||
let(
|
|
||||||
dict = [["0", 0], ["1", 1], ["2", 2], ["3", 3], ["4", 4], ["5", 5], ["6", 6], ["7", 7], ["8", 8], ["9", 9]],
|
|
||||||
n = dict[search(t, dict)[0]][1]
|
|
||||||
) n;
|
|
||||||
|
|
||||||
function _parse_positive_int(t, value = 0, i = 0) =
|
function _parse_positive_int(t, value = 0, i = 0) =
|
||||||
i == len(t) ? value : _parse_positive_int(t, value * pow(10, i) + _str_to_int(t[i]), i + 1);
|
i == len(t) ? value : _parse_positive_int(t, value * pow(10, i) + _str_to_int(t[i]), i + 1);
|
||||||
|
Reference in New Issue
Block a user