Skip to content

Commit d3fa114

Browse files
committed
Merge from aptx4869
1 parent 73a4e2b commit d3fa114

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

Gruntfile.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = (grunt) ->
2-
require('load-grunt-tasks') grunt
2+
require('load-grunt-tasks') grunt , {
3+
pattern: ['grunt-*', '!grunt-template-jasmine-istanbul']
4+
}
35
grunt.file.readJSON('package.json')
46

57
# !! Compile configurations

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
[![Bower version](https://badge.fury.io/bo/comment-core-library.svg)](http://badge.fury.io/bo/comment-core-library)
44
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
55
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
6-
[![Build Status: Linux](https://travis-ci.org/aptx4869/CommentCoreLibrary.svg?branch=auto-test)](https://travis-ci.org/aptx4869/CommentCoreLibrary)
7-
<!--[![Build Status: Linux](https://travis-ci.org/jabbany/CommentCoreLibrary.svg?branch=master)](https://travis-ci.org/jabbany/CommentCoreLibrary)-->
8-
[![Coverage Status](https://coveralls.io/repos/aptx4869/CommentCoreLibrary/badge.png?branch=auto-test)](https://coveralls.io/r/aptx4869/CommentCoreLibrary?branch=auto-test)
9-
<!--[![Coverage Status](https://img.shields.io/coveralls/jabbany/CommentCoreLibrary.svg)](https://coveralls.io/r/jabbany/CommentCoreLibrary?branch=master)-->
6+
[![Build Status: Linux](https://travis-ci.org/jabbany/CommentCoreLibrary.svg?branch=master)](https://travis-ci.org/jabbany/CommentCoreLibrary)
7+
[![Coverage Status](https://img.shields.io/coveralls/jabbany/CommentCoreLibrary.svg)](https://coveralls.io/r/jabbany/CommentCoreLibrary?branch=master)
108

119
The CommentCoreLibrary is a set of Javascript modules that make up the
1210
core controller for comments streaming on top of timed media (video or audio).

build/CommentCoreLibrary.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
var BinArray = (function(){
77
var BinArray = {};
88
BinArray.bsearch = function(arr, what, how){
9-
if(arr.length == 0) return 0;
10-
if(how(what,arr[0]) < 0) return 0;
11-
if(how(what,arr[arr.length - 1]) >=0) return arr.length;
9+
if(arr.length === 0) {
10+
return 0;
11+
}
12+
if(how(what,arr[0]) < 0) {
13+
return 0;
14+
}
15+
if(how(what,arr[arr.length - 1]) >=0) {
16+
return arr.length;
17+
}
1218
var low =0;
1319
var i = 0;
1420
var count = 0;
@@ -18,15 +24,17 @@ var BinArray = (function(){
1824
count++;
1925
if(how(what,arr[i-1])>=0 && how(what,arr[i])<0){
2026
return i;
21-
}else if(how(what,arr[i-1])<0){
27+
}
28+
if(how(what,arr[i-1])<0){
2229
high = i-1;
2330
}else if(how(what,arr[i])>=0){
2431
low = i;
25-
}else
32+
}else {
2633
console.error('Program Error');
27-
if(count > 1500) console.error('Too many run cycles.');
34+
}
35+
if(count > 1500) { console.error('Too many run cycles.'); }
2836
}
29-
return -1;
37+
return -1; //this line can never been run
3038
};
3139
BinArray.binsert = function(arr, what, how){
3240
var index = BinArray.bsearch(arr,what,how);

0 commit comments

Comments
 (0)