This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 e14cdfe5 Extract redundant code.
e14cdfe5 is described below
commit e14cdfe55f4837b63daca367374ce996ad87fc5a
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jul 25 08:34:50 2026 -0400
Extract redundant code.
---
src/main/java/org/apache/commons/codec/binary/Base58.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/codec/binary/Base58.java
b/src/main/java/org/apache/commons/codec/binary/Base58.java
index 00e6c147..7633646a 100644
--- a/src/main/java/org/apache/commons/codec/binary/Base58.java
+++ b/src/main/java/org/apache/commons/codec/binary/Base58.java
@@ -335,8 +335,9 @@ public class Base58 extends BaseNCodec {
base58.append((char) (encodeTable[divRem[1].intValue()] & 0xff));
value = divRem[0];
}
+ final char zero = (char) (encodeTable[0] & 0xff);
for (int i = 0; i < leadingZeros; i++) {
- base58.append((char) (encodeTable[0] & 0xff));
+ base58.append(zero);
}
return base58;
}