MCPcopy Create free account
hub / github.com/microsoft/SandDance / decodeCodePointsArray

Function decodeCodePointsArray

docs/app/js/sanddance-app.js:113534–113543  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

113532// We go 1 magnitude less, for safety
113533var MAX_ARGUMENTS_LENGTH = 0x1000;
113534function decodeCodePointsArray(codePoints) {
113535 var len = codePoints.length;
113536 if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
113537 ;
113538 // Decode in chunks to avoid "call stack size exceeded".
113539 var res = "";
113540 var i = 0;
113541 while(i < len)res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
113542 return res;
113543}
113544function asciiSlice(buf, start, end) {
113545 var ret = "";
113546 end = Math.min(buf.length, end);

Callers 1

utf8SliceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected