You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/06/26 19:25:31 UTC
[commons-text] branch master updated: Make parameter final.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push:
new 236bd58 Make parameter final.
236bd58 is described below
commit 236bd58c5227b48a9010ad620cf348dc8f866206
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 26 15:25:24 2020 -0400
Make parameter final.
---
.../org/apache/commons/text/matcher/AbstractStringMatcher.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java b/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java
index e3cd696..043a0d8 100644
--- a/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java
+++ b/src/main/java/org/apache/commons/text/matcher/AbstractStringMatcher.java
@@ -184,13 +184,14 @@ abstract class AbstractStringMatcher implements StringMatcher {
* @return The number of matching characters, zero for no match
*/
@Override
- public int isMatch(final char[] buffer, int start, final int bufferStart, final int bufferEnd) {
+ public int isMatch(final char[] buffer, final int start, final int bufferStart, final int bufferEnd) {
final int len = size();
if (start + len > bufferEnd) {
return 0;
}
- for (int i = 0; i < len; i++, start++) {
- if (chars[i] != buffer[start]) {
+ int j = start;
+ for (int i = 0; i < len; i++, j++) {
+ if (chars[i] != buffer[j]) {
return 0;
}
}