Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Jul 6, 2017
1 parent e8c964d commit 57fe8c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ module.exports = class Kernel {
const message = await this.ports.getNextMessage()
if (!message) break

// dequqe message
message.fromPort.messages.shift()
// if the message we recived had more ticks then we currently have the
// update it
// if the message we recived had more ticks then we currently have the
// update it
if (message._fromTicks > this.ticks) {
this.ticks = message._fromTicks
this.hypervisor.scheduler.update(this)
Expand All @@ -81,7 +82,6 @@ module.exports = class Kernel {
delete message.responsePort

this.ports.addReceivedPorts(message)
message._hops++

if (message.constructor === DeleteMessage) {
this.ports._delete(message.fromName)
Expand Down Expand Up @@ -164,6 +164,7 @@ module.exports = class Kernel {
* @param {Message} message - the message
*/
async send (port, message) {
message._hops++
// set the port that the message came from
message._fromTicks = this.ticks
this.ports.removeSentPorts(message)
Expand Down

0 comments on commit 57fe8c9

Please sign in to comment.