nl_tokens: / * Ol . prototype . getManyAt = function ( typeCode endEditId cb ) { var many = 0 var sts = this . typeCodeSubTypes [ typeCode ] for ( var j = 0 ; j<sts . length ; ++ j ) { var tc = sts [ j ] var editIds = this . creationEditIdsByType [ tc ] if ( editIds ) { for ( var i = 0 ; i<editIds . length ; ++ i ) { // TODO use binary search var editId = editIds [ i ] if ( editId > endEditId ) { break // creationEditIdsByType is sequential } ++ many } var destroyedEditIds = this . destructionEditIdsByType [ tc ] if ( destroyedEditIds ) { for ( var i = 0 ; i<destroyedEditIds . length ; ++ i ) { var editId = destroyedEditIds [ i ] if ( editId > endEditId ) { break // creationEditIdsByType is sequential } -- many } } } } if ( cb ) cb ( many ) return many } / * Ol . prototype . getAllIdsOfTypeAt = function ( typeCode endEditId cb ) { var res = [] var sts = this . typeCodeSubTypes [ typeCode ] for ( var j = 0 ; j<sts . length ; ++ j ) { var tc = sts [ j ] var ids = this . idsByType [ tc ] || [] ; var editIds = this . creationEditIdsByType [ tc ] for ( var i = 0 ; i<ids . length ; ++ i ) { var id = ids [ i ] if ( !this . destroyed [ id ] ) { var editId = editIds [ i ] if ( editId > endEditId ) { break // creationEditIdsByType is sequential } res . push ( id ) } }
pl_tokens: function binarySearchNext ( arr , value ) { var low = 0 , high = arr . length - 1 , i , comparison ; while ( low <= high ) { i = Math . floor ( ( low + high ) / 2 ) ; if ( arr [ i ] < value ) { low = i + 1 ; continue ; } ; if ( arr [ i ] > <mask> ) { high = i - 1 ; continue ; } ; return i ; } return i ; }