From 6661a2d96ee5f9aa6b2f01628c3e9422351afed1 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Fri, 28 Mar 2003 19:58:36 +0000 Subject: [PATCH] Tweak; another few milliseconds faster git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1644 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/src/net/sourceforge/pmd/cpd/Mark.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pmd/src/net/sourceforge/pmd/cpd/Mark.java b/pmd/src/net/sourceforge/pmd/cpd/Mark.java index 06df1dbba4..e41f317eaf 100644 --- a/pmd/src/net/sourceforge/pmd/cpd/Mark.java +++ b/pmd/src/net/sourceforge/pmd/cpd/Mark.java @@ -4,15 +4,15 @@ import java.util.List; public class Mark { - private int index; - private int offset; + private int indexIntoFile; + private int indexIntoTokenArray; private List code; private String file; public Mark(List code, int offset, String file, int index) { this.code = code; - this.offset = offset; - this.index = index; + this.indexIntoTokenArray = offset; + this.indexIntoFile = index; this.file = file; } @@ -21,19 +21,15 @@ public class Mark { } public int getIndexIntoFile() { - return this.index; + return this.indexIntoFile; } public int getIndexIntoTokenArray() { - return offset; + return indexIntoTokenArray; } public TokenEntry tokenAt(int index) { - if (index < 0) { - return (TokenEntry)code.get((code.size() + index + offset) % code.size()); - } else { - return (TokenEntry)code.get((index + offset) % code.size()); - } + return (TokenEntry)code.get((index + indexIntoTokenArray) % code.size()); } }