aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/healthmarketscience/jackcess/Index.java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2008-03-11 20:40:13 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2008-03-11 20:40:13 +0000
commit379669147b0118a39d432568c6a3b6cb6c454e6d (patch)
tree936137912fba3a7a39b836a6dd87180b40563209 /src/java/com/healthmarketscience/jackcess/Index.java
parentcd8798cb54ad84e55e13ed2831a9512003fa7ecc (diff)
downloadjackcess-379669147b0118a39d432568c6a3b6cb6c454e6d.tar.gz
jackcess-379669147b0118a39d432568c6a3b6cb6c454e6d.zip
add support for reading table relationships; minor refactor of table creation; minor features added to cursorbuilder
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@266 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com/healthmarketscience/jackcess/Index.java')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Index.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Index.java b/src/java/com/healthmarketscience/jackcess/Index.java
index 0146c2b..fbf4390 100644
--- a/src/java/com/healthmarketscience/jackcess/Index.java
+++ b/src/java/com/healthmarketscience/jackcess/Index.java
@@ -643,15 +643,22 @@ public class Index implements Comparable<Index> {
{
initialize();
Position startPos = FIRST_POSITION;
+ byte[] startEntryBytes = null;
if(startRow != null) {
- Entry startEntry = new Entry(createEntryBytes(startRow),
+ startEntryBytes = createEntryBytes(startRow);
+ Entry startEntry = new Entry(startEntryBytes,
(startInclusive ?
RowId.FIRST_ROW_ID : RowId.LAST_ROW_ID));
startPos = new Position(FIRST_ENTRY_IDX, startEntry);
}
Position endPos = LAST_POSITION;
if(endRow != null) {
- Entry endEntry = new Entry(createEntryBytes(endRow),
+ // reuse startEntryBytes if startRow and endRow are same array. this is
+ // common for "lookup" code
+ byte[] endEntryBytes = ((startRow == endRow) ?
+ startEntryBytes :
+ createEntryBytes(endRow));
+ Entry endEntry = new Entry(endEntryBytes,
(endInclusive ?
RowId.LAST_ROW_ID : RowId.FIRST_ROW_ID));
endPos = new Position(LAST_ENTRY_IDX, endEntry);