Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit027f213

Browse files
committed
Recompile JS. Bump to 0.1.4 to avoid confusion
1 parent29dbb2b commit027f213

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

‎gulpfile.coffee‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
browserify=require('browserify')
2+
coffeeify=require('coffeeify')
23
del=require('del')
34
gulp=require('gulp')
45
gutil=require('gulp-util')

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"js-priority-queue",
3-
"version":"0.1.3",
3+
"version":"0.1.4",
44
"description":"Priority queue data structures",
55
"main":"priority-queue.js",
66
"scripts": {},

‎priority-queue.js‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function(f){if(typeofexports==="object"&&typeofmodule!=="undefined"){module.exports=f()}elseif(typeofdefine==="function"&&define.amd){define([],f)}else{varg;if(typeofwindow!=="undefined"){g=window}elseif(typeofglobal!=="undefined"){g=global}elseif(typeofself!=="undefined"){g=self}else{g=this}g.PriorityQueue=f()}})(function(){vardefine,module,exports;return(functione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara=typeofrequire=="function"&&require;if(!u&&a)returna(o,!0);if(i)returni(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returns(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}vari=typeofrequire=="function"&&require;for(varo=0;o<r.length;o++)s(r[o]);returns})({1:[function(require,module,exports){
22
varAbstractPriorityQueue,ArrayStrategy,BHeapStrategy,BinaryHeapStrategy,PriorityQueue,
3-
__hasProp={}.hasOwnProperty,
4-
__extends=function(child,parent){for(varkeyinparent){if(__hasProp.call(parent,key))child[key]=parent[key];}functionctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=newctor();child.__super__=parent.prototype;returnchild;};
3+
extend=function(child,parent){for(varkeyinparent){if(hasProp.call(parent,key))child[key]=parent[key];}functionctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=newctor();child.__super__=parent.prototype;returnchild;},
4+
hasProp={}.hasOwnProperty;
55

66
AbstractPriorityQueue=require('./PriorityQueue/AbstractPriorityQueue');
77

@@ -11,8 +11,8 @@ BinaryHeapStrategy = require('./PriorityQueue/BinaryHeapStrategy');
1111

1212
BHeapStrategy=require('./PriorityQueue/BHeapStrategy');
1313

14-
PriorityQueue=(function(_super){
15-
__extends(PriorityQueue,_super);
14+
PriorityQueue=(function(superClass){
15+
extend(PriorityQueue,superClass);
1616

1717
functionPriorityQueue(options){
1818
options||(options={});
@@ -41,14 +41,15 @@ var AbstractPriorityQueue;
4141

4242
module.exports=AbstractPriorityQueue=(function(){
4343
functionAbstractPriorityQueue(options){
44+
varref;
4445
if((options!=null ?options.strategy :void0)==null){
4546
throw'Must pass options.strategy, a strategy';
4647
}
4748
if((options!=null ?options.comparator :void0)==null){
4849
throw'Must pass options.comparator, a comparator';
4950
}
5051
this.priv=newoptions.strategy(options);
51-
this.length=0;
52+
this.length=(options!=null ?(ref=options.initialValues)!=null ?ref.length :void0 :void0)||0;
5253
}
5354

5455
AbstractPriorityQueue.prototype.queue=function(value){
@@ -102,10 +103,10 @@ binarySearchForIndexReversed = function(array, value, comparator) {
102103

103104
module.exports=ArrayStrategy=(function(){
104105
functionArrayStrategy(options){
105-
var_ref;
106+
varref;
106107
this.options=options;
107108
this.comparator=this.options.comparator;
108-
this.data=((_ref=this.options.initialValues)!=null ?_ref.slice(0) :void0)||[];
109+
this.data=((ref=this.options.initialValues)!=null ?ref.slice(0) :void0)||[];
109110
this.data.sort(this.comparator).reverse();
110111
}
111112

@@ -139,7 +140,7 @@ var BHeapStrategy;
139140

140141
module.exports=BHeapStrategy=(function(){
141142
functionBHeapStrategy(options){
142-
vararr,i,shift,value,_i,_j,_len,_ref,_ref1;
143+
vararr,i,j,k,len,ref,ref1,shift,value;
143144
this.comparator=(options!=null ?options.comparator :void0)||function(a,b){
144145
returna-b;
145146
};
@@ -154,15 +155,15 @@ module.exports = BHeapStrategy = (function() {
154155
}
155156
this._shift=shift;
156157
this._emptyMemoryPageTemplate=arr=[];
157-
for(i=_i=0,_ref=this.pageSize;0<=_ref ?_i<_ref :_i>_ref;i=0<=_ref ?++_i :--_i){
158+
for(i=j=0,ref=this.pageSize;0<=ref ?j<ref :j>ref;i=0<=ref ?++j :--j){
158159
arr.push(null);
159160
}
160161
this._memory=[];
161162
this._mask=this.pageSize-1;
162163
if(options.initialValues){
163-
_ref1=options.initialValues;
164-
for(_j=0,_len=_ref1.length;_j<_len;_j++){
165-
value=_ref1[_j];
164+
ref1=options.initialValues;
165+
for(k=0,len=ref1.length;k<len;k++){
166+
value=ref1[k];
166167
this.queue(value);
167168
}
168169
}
@@ -290,19 +291,19 @@ var BinaryHeapStrategy;
290291

291292
module.exports=BinaryHeapStrategy=(function(){
292293
functionBinaryHeapStrategy(options){
293-
var_ref;
294+
varref;
294295
this.comparator=(options!=null ?options.comparator :void0)||function(a,b){
295296
returna-b;
296297
};
297298
this.length=0;
298-
this.data=((_ref=options.initialValues)!=null ?_ref.slice(0) :void0)||[];
299+
this.data=((ref=options.initialValues)!=null ?ref.slice(0) :void0)||[];
299300
this._heapify();
300301
}
301302

302303
BinaryHeapStrategy.prototype._heapify=function(){
303-
vari,_i,_ref;
304+
vari,j,ref;
304305
if(this.data.length>0){
305-
for(i=_i=1,_ref=this.data.length;1<=_ref ?_i<_ref :_i>_ref;i=1<=_ref ?++_i :--_i){
306+
for(i=j=1,ref=this.data.length;1<=ref ?j<ref :j>ref;i=1<=ref ?++j :--j){
306307
this._bubbleUp(i);
307308
}
308309
}

‎priority-queue.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp