Skip to content

Commit

Permalink
Refactored utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Dec 7, 2013
1 parent 79fa68d commit ea8f74e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
9 changes: 9 additions & 0 deletions lib/addArea.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";


module.exports = function(rectangles){
rectangles.forEach(function(rect){
rect.area = rect.w * rect.h;
});
return rectangles;
};
11 changes: 0 additions & 11 deletions lib/utils.js

This file was deleted.

6 changes: 3 additions & 3 deletions lib/windowOpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
var Envelope = require("./Envelope");
var RectState = require("./RectState");
var lookAhead = require("./lookAhead");
var sort = require("./sort");
var utils = require("./utils");
var sort = require("./sort") ;
var addArea = require("./addArea");


function windowOpt(rectangles, produceScore, depth, finalDepth){
if(isNaN(rectangles[0].area)){
utils.addArea(rectangles);
addArea(rectangles);
}
sort.byAreaDescending(rectangles);

Expand Down

0 comments on commit ea8f74e

Please sign in to comment.