Give CS loops a hand.

This commit is contained in:
Mayhem 2013-08-23 15:34:42 +02:00
parent b394a81494
commit de82bd3e45
4 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ Polyfill =
# DataUrl to Binary code from Aeosynth's 4chan X repo # DataUrl to Binary code from Aeosynth's 4chan X repo
l = data.length l = data.length
ui8a = new Uint8Array l ui8a = new Uint8Array l
for i in [0...l] for i in [0...l] by 1
ui8a[i] = data.charCodeAt i ui8a[i] = data.charCodeAt i
cb new Blob [ui8a], type: 'image/png' cb new Blob [ui8a], type: 'image/png'
visibility: -> visibility: ->

View File

@ -220,7 +220,7 @@ Main =
len = nodes.length len = nodes.length
for callback in klass::callbacks for callback in klass::callbacks
# c.profile callback.name # c.profile callback.name
for i in [0...len] for i in [0...len] by 1
node = nodes[i] node = nodes[i]
try try
callback.cb.call node callback.cb.call node

View File

@ -73,7 +73,7 @@ class Post
text = [] text = []
# XPathResult.ORDERED_NODE_SNAPSHOT_TYPE === 7 # XPathResult.ORDERED_NODE_SNAPSHOT_TYPE === 7
nodes = d.evaluate './/br|.//text()', bq, null, 7, null nodes = d.evaluate './/br|.//text()', bq, null, 7, null
for i in [0...nodes.snapshotLength] for i in [0...nodes.snapshotLength] by 1
text.push nodes.snapshotItem(i).data or '\n' text.push nodes.snapshotItem(i).data or '\n'
@info.comment = text.join('').trim().replace /\s+$/gm, '' @info.comment = text.join('').trim().replace /\s+$/gm, ''

View File

@ -35,6 +35,6 @@ IDColor =
hash: (uniqueID) -> hash: (uniqueID) ->
msg = 0 msg = 0
for i in [0...uniqueID.length] for i in [0...uniqueID.length] by 1
msg = (msg << 5) - msg + uniqueID.charCodeAt i msg = (msg << 5) - msg + uniqueID.charCodeAt i
msg msg