X-Git-Url: http://plrg.eecs.uci.edu/git/?p=iotcloud.git;a=blobdiff_plain;f=src%2Fjs%2Fiotjs%2Forig%2Fslotbuffer.js;h=1e769719e22f6baf70e8fe2092d8e136b136f652;hp=7c29463b2122d7b3db2db2cf93002ed58c7a3280;hb=d257683b21884821ee4a60c76cbc64cb5ee6df4c;hpb=2bd6f7a0cbf2b44d6e12d4cb1445d8f442bba859 diff --git a/src/js/iotjs/orig/slotbuffer.js b/src/js/iotjs/orig/slotbuffer.js index 7c29463..1e76971 100644 --- a/src/js/iotjs/orig/slotbuffer.js +++ b/src/js/iotjs/orig/slotbuffer.js @@ -7,8 +7,8 @@ class SlotBuffer{ this.oldestseqn = 0; } size(){ - if(this.head>=tail){ - return head-tail; + if(this.head>=this.tail){ + return this.head-this.tail; } return (this.array.length + this.head - this.tail); } @@ -73,7 +73,7 @@ class SlotBuffer{ return null; } - if(this.head >= this.tail && index >= head){ + if(this.head >= this.tail && index >= this.head){ return null; }