Skip to content

Commit

Permalink
Add toLazyText
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Jun 5, 2012
1 parent f924542 commit 40ff471
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rts/rts-common.js
Expand Up @@ -1925,6 +1925,18 @@ var $hs_toText = function(s) {
dest[i]=0;
return $d(1, [a, 0, s.length]);
};
/**
* @param {string} s
* @return {!Object}
*/
var $hs_toLazyText = function(s) {
var a = $hs_newByteArrayzh((s.length << 1) + 2)[1];
var dest = new Uint16Array(a[0]);
for(var i=0;i!=s.length;i++)
dest[i]=s.charCodeAt(i);
dest[i]=0;
return $d(2, [a, 0, s.length, $d(1, [])]);
};
/**
* @param {Array.<Object>} args
* @param {function(!number)} onComplete
Expand Down

0 comments on commit 40ff471

Please sign in to comment.