Skip to content

Commit 07c56f7

Browse files
committed
Merge bugfix and improve logic for comment pool limiting.
1 parent 01f9e84 commit 07c56f7

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

build/CommentCoreLibrary.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,23 +824,26 @@ var CommentManager = (function() {
824824
};
825825
CommentManager.prototype.init = function(){
826826
this.setBounds();
827-
if(this.filter == null)
827+
if(this.filter == null) {
828828
this.filter = new CommentFilter(); //Only create a filter if none exist
829+
}
829830
};
830831
CommentManager.prototype.time = function(time){
831832
time = time - 1;
832833
if(this.position >= this.timeline.length || Math.abs(this.lastPos - time) >= 2000){
833834
this.seek(time);
834835
this.lastPos = time;
835-
if(this.timeline.length <= this.position)
836+
if(this.timeline.length <= this.position) {
836837
return;
838+
}
837839
}else{
838840
this.lastPos = time;
839841
}
840842
for(;this.position < this.timeline.length;this.position++){
841-
if(this.options.limit > 0 && this.runline.length > this.limiter) break;
842843
if(this.timeline[this.position]['stime']<=time){
843-
if(this.validate(this.timeline[this.position])){
844+
if(this.options.limit > 0 && this.runline.length > this.limiter) {
845+
continue; // Skip comments but still move the position pointer
846+
} else if(this.validate(this.timeline[this.position])){
844847
this.send(this.timeline[this.position]);
845848
}
846849
}else{

0 commit comments

Comments
 (0)