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-codec.git


The following commit(s) were added to refs/heads/master by this push:
     new d897435a Refactor NUL magic char
     new 56b292a0 Merge branch 'master' of 
https://gitbox.apache.org/repos/asf/commons-codec.git
d897435a is described below

commit d897435ae032cc4224aed8627f3628887c3edf78
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Jan 28 13:58:28 2025 -0500

    Refactor NUL magic char
---
 .../org/apache/commons/codec/language/DaitchMokotoffSoundex.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java 
b/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
index a2cf6a2f..7734d057 100644
--- a/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
+++ b/src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java
@@ -68,6 +68,11 @@ import org.apache.commons.codec.StringEncoder;
  */
 public class DaitchMokotoffSoundex implements StringEncoder {
 
+    /**
+     * The NUL character.
+     */
+    private static final char NUL = '\0';
+
     /**
      * Inner class representing a branch during DM soundex encoding.
      */
@@ -461,7 +466,7 @@ public class DaitchMokotoffSoundex implements StringEncoder 
{
         final Set<Branch> currentBranches = new LinkedHashSet<>();
         currentBranches.add(new Branch());
 
-        char lastChar = '\0';
+        char lastChar = NUL;
         for (int index = 0; index < input.length(); index++) {
             final char ch = input.charAt(index);
 

Reply via email to