aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-23 11:24:35 -0700
committeralon@honor <none@none>2010-10-23 11:24:35 -0700
commitbdf551e4e041814bab99f0f774684fb3c5bd812f (patch)
tree5a556136aaec037ffa07387f56b2c2ea9ac8f51f /src/utility.js
parent3e7515aa768ada28f640c172a7c355146e75004d (diff)
optimize out unneeded item[0]
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utility.js b/src/utility.js
index c28077e8..3085fc61 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -1,15 +1,16 @@
// General JS utilities
function dump(item) {
+ var CHUNK = 500;
function lineify(text) {
var ret = '';
while (text.length > 0) {
- if (text.length < 80) {
+ if (text.length < CHUNK) {
ret += text;
return ret;
}
- var subText = text.substring(60, 80);
- var index = 61+Math.max(subText.indexOf(','), subText.indexOf(']'), subText.indexOf('}'), 21);
+ var subText = text.substring(CHUNK-20, CHUNK);
+ var index = CHUNK-19+Math.max(subText.indexOf(','), subText.indexOf(']'), subText.indexOf('}'), 21);
ret += text.substr(0,index) + '\n';
text = '// ' + text.substr(index);
}