From 635699a563e7b34a1723e965fb79a9965efadeeb Mon Sep 17 00:00:00 2001 From: David Wayne Smiley Date: Tue, 4 Sep 2012 16:59:27 +0000 Subject: [PATCH] LUCENE-4342 errant +1 in spatial prefix tree factory getLevelForDistance() git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1380739 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/lucene/spatial/prefix/tree/GeohashPrefixTree.java | 2 +- .../org/apache/lucene/spatial/prefix/tree/QuadPrefixTree.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/GeohashPrefixTree.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/GeohashPrefixTree.java index 0dfe6bac92a..a26e0401457 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/GeohashPrefixTree.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/GeohashPrefixTree.java @@ -40,7 +40,7 @@ public class GeohashPrefixTree extends SpatialPrefixTree { @Override protected int getLevelForDistance(double degrees) { GeohashPrefixTree grid = new GeohashPrefixTree(ctx, GeohashPrefixTree.getMaxLevelsPossible()); - return grid.getLevelForDistance(degrees) + 1;//returns 1 greater + return grid.getLevelForDistance(degrees); } @Override diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/QuadPrefixTree.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/QuadPrefixTree.java index dde2d5b16af..9ec0a8e46d0 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/QuadPrefixTree.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/QuadPrefixTree.java @@ -41,7 +41,7 @@ public class QuadPrefixTree extends SpatialPrefixTree { @Override protected int getLevelForDistance(double degrees) { QuadPrefixTree grid = new QuadPrefixTree(ctx, MAX_LEVELS_POSSIBLE); - return grid.getLevelForDistance(degrees) + 1;//returns 1 greater + return grid.getLevelForDistance(degrees); } @Override