Fix global leak and incorrect var

This commit is contained in:
Ritchie 2013-06-27 12:21:31 -07:00
parent 64da1d441a
commit ce63ef9ac2
2 changed files with 4 additions and 4 deletions

View File

@ -323,7 +323,7 @@ DataAccessObject.find = function find(params, cb) {
if(near) {
if(supportsGeo) {
// convert it
this.schema.adapter.buildNearFilter(filter, near);
this.schema.adapter.buildNearFilter(params, near);
} else if(params.where) {
// do in memory query
// using all documents

View File

@ -185,9 +185,9 @@ function geoDistance(x1, y1, x2, y2, options) {
x2 = x2 * DEG2RAD;
y2 = y2 * DEG2RAD;
a = Math.pow(Math.sin(( y2-y1 ) / 2.0 ), 2);
b = Math.pow(Math.sin(( x2-x1 ) / 2.0 ), 2);
c = Math.sqrt( a + Math.cos( y2 ) * Math.cos( y1 ) * b );
var a = Math.pow(Math.sin(( y2-y1 ) / 2.0 ), 2);
var b = Math.pow(Math.sin(( x2-x1 ) / 2.0 ), 2);
var c = Math.sqrt( a + Math.cos( y2 ) * Math.cos( y1 ) * b );
var type = (options && options.type) || 'miles';