Skip to content

Commit e8f93b6

Browse files
committed
whitespace and comments
1 parent 23468ba commit e8f93b6

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

daimio/pathfinders/zkeyfinder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ D.import_pathfinder('key', {
2929
// }
3030

3131
// TODO: array + numeric key -> sparse array. fill in the blanks with "" (all Daimio lists are dense)
32+
33+
// if(!value.length && Array.isArray(value))
34+
// value = // oh crap we can't convert [] to {} w/o hosing the pointer
35+
3236
value[key] = new_val
3337
}
3438
})

daimio/pflavs/internal.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ D.import_port_flavour('up', {
2020

2121
D.import_port_flavour('down', {
2222
dir: 'down',
23-
exit: function(ship, process, callback) {
23+
exit: function(ship, process) {
2424
// go down, then return back up...
2525
// THINK: is the callback param the right way to do this?? it's definitely going to complicate things...
2626

2727
var self = this
2828
D.setImmediate(function() {
29-
// THINK: ideally there's only ONE route from a downport. can we formalize that?
3029
// self.outs.forEach(function(port) {
3130
// port.enter(ship)
3231
// })
32+
33+
// THINK: whether we can pass multiple ships or have to queue them depends on our routes: if they're all bidirectional we can chain the callbacks, otherwise we have to send them one at a time.
34+
35+
// THINK: ideally there's only ONE route from a downport. can we formalize that?
3336
port = self.outs[0]
3437
if(port) {
3538
port.enter(ship, process, callback) // wat

tests/workers.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
function enqueue(iterations) {
3535
queue.push(iterations)
3636
if(!working)
37-
dequeue()
38-
}
37+
dequeue() }
3938

4039
function actualRunWorker(iterations) {
4140
worker.onmessage = function(event) {
@@ -51,25 +50,21 @@
5150
function dequeue() {
5251
if(queue.length) {
5352
actualRunWorker(queue.shift())
54-
working = true
55-
}
56-
}
53+
working = true } }
5754

5855
function runWorker(iterations) {
59-
enqueue(iterations)
60-
}
56+
enqueue(iterations) }
6157

6258

6359
function runNormal(iterations) {
6460
var start = new Date().getTime()
6561
for(var i = iterations; i; i--)
6662
collatz(i)
67-
display('normal', iterations, start)
68-
}
63+
display('normal', iterations, start) }
6964

7065

7166
function display(el, iter, time) {
72-
document.getElementById(el + '-' + iter).textContent = new Date().getTime() - time}
67+
document.getElementById(el + '-' + iter).textContent = new Date().getTime() - time }
7368

7469
document.addEventListener('DOMContentLoaded', function() {
7570
runNormal(1000)

0 commit comments

Comments
 (0)