From 3a10d6d185d0902b2992883a47496e2986534a3b Mon Sep 17 00:00:00 2001 From: UnfamiliarLegacy <74633542+UnfamiliarLegacy@users.noreply.github.com> Date: Sat, 6 Jul 2024 01:08:21 +0200 Subject: [PATCH] Base64 style points --- .../main/java/gearth/encoding/Base64Encoding.java | 12 ++++-------- pom.xml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/G-Earth/src/main/java/gearth/encoding/Base64Encoding.java b/G-Earth/src/main/java/gearth/encoding/Base64Encoding.java index 02aaaf7..bf45ceb 100644 --- a/G-Earth/src/main/java/gearth/encoding/Base64Encoding.java +++ b/G-Earth/src/main/java/gearth/encoding/Base64Encoding.java @@ -20,14 +20,10 @@ public class Base64Encoding { public static int decode(byte[] data) { int res = 0; - for (int k = data.length - 1, i = 0; k >= 0; k--, i++) - { - int x = data[k] - 0x40; - if (i > 0){ - res += x << (i * 6); - } else { - res += x; - } + for (byte x : data) { + final int byteVal = x - 0x40; + + res = (res << 6) | byteVal; } return res; diff --git a/pom.xml b/pom.xml index 3e2c7b6..e2c5cfd 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ - 1.5.4-beta-5 + 1.5.4-beta-6 -SNAPSHOT 1.5.3