1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-14 11:11:55 +02:00
This commit is contained in:
Justin Lin 2019-08-21 19:55:10 +08:00
parent 76f8debeb2
commit ef7adbdbc0

View File

@ -8,11 +8,7 @@
*
**/
function _str_to_int(t) =
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 _str_to_int(t) = ord(t) - 48;
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);